(p)
| 5428 | }; |
| 5429 | |
| 5430 | var h = function(p) { |
| 5431 | if (storagePermission.asked) { |
| 5432 | // asked earlier, but not now |
| 5433 | if (cb) cb(p, false); |
| 5434 | } else if (p) { |
| 5435 | // we have permission :) |
| 5436 | cb(p, false); |
| 5437 | } else { |
| 5438 | // we don't have permission and also don't have asked yet |
| 5439 | storagePermission.askForPermission(gotPerm); |
| 5440 | } |
| 5441 | |
| 5442 | // only once in a lifetime (TM) :) |
| 5443 | storagePermission.asked = true; |
| 5444 | }; |
| 5445 | |
| 5446 | permission.has(permission.permStorage, h); |
| 5447 | }, |