summaryrefslogtreecommitdiffstats
path: root/extensions/browser/api/runtime/runtime_api.h
diff options
context:
space:
mode:
authorlazyboy <lazyboy@chromium.org>2015-12-09 15:39:35 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-09 23:40:51 +0000
commit90c1469d03da00e99c0b6ff6a9871c65fa2b3e4c (patch)
treef3572f3c54f5e913d0e0a9855ec874df97de6888 /extensions/browser/api/runtime/runtime_api.h
parent84b9c43f19b18bbd7ce85b664fa8a98f4a53dbf6 (diff)
downloadchromium_src-90c1469d03da00e99c0b6ff6a9871c65fa2b3e4c.zip
chromium_src-90c1469d03da00e99c0b6ff6a9871c65fa2b3e4c.tar.gz
chromium_src-90c1469d03da00e99c0b6ff6a9871c65fa2b3e4c.tar.bz2
Dispatch runtime.onInstalled event if an extension is re-enabled after
it was disabled due to permission escalation. BUG=561660 Test=Provide an update of an extension that has more permissions than the previous one (e.g. "bookmarks"). Once the new version is installed, notice that there's a warning in chrome hotdog menu to accept new permissions. Upon accepting the permissions, observe chrome.runtime.onInstalled handler fires on the new version of the extension. See https://github.com/lazyboy/chromium/tree/master/tests/extensions/update_flow for detailed repro steps. Review URL: https://codereview.chromium.org/1499493003 Cr-Commit-Position: refs/heads/master@{#364215}
Diffstat (limited to 'extensions/browser/api/runtime/runtime_api.h')
-rw-r--r--extensions/browser/api/runtime/runtime_api.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/extensions/browser/api/runtime/runtime_api.h b/extensions/browser/api/runtime/runtime_api.h
index 28ff852..a9ed93f 100644
--- a/extensions/browser/api/runtime/runtime_api.h
+++ b/extensions/browser/api/runtime/runtime_api.h
@@ -93,6 +93,14 @@ class RuntimeAPI : public BrowserContextKeyedAPI,
// ProcessManagerObserver implementation:
void OnBackgroundHostStartup(const Extension* extension) override;
+ // Pref related functions that deals with info about installed extensions that
+ // has not been loaded yet.
+ // Used to send chrome.runtime.onInstalled event upon loading the extensions.
+ bool ReadPendingOnInstallInfoFromPref(const ExtensionId& extension_id,
+ base::Version* previous_version);
+ void RemovePendingOnInstallInfoFromPref(const ExtensionId& extension_id);
+ void StorePendingOnInstallInfoToPref(const Extension* extension);
+
scoped_ptr<RuntimeAPIDelegate> delegate_;
content::BrowserContext* browser_context_;