Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(804)

Unified Diff: chrome/common/extensions/extension.cc

Issue 11361189: Initial skeleton for System Indicator API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase; Make system_indicator manifest entry grant systemIndicator permission. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 2ed5e3d3698956936597de2c79902da18c3269ee..ddda21dbeb76ad42e030603a2da98092285bca4a 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -2186,7 +2186,7 @@ bool Extension::LoadFileHandlers(string16* error) {
return true;
}
-bool Extension::LoadExtensionFeatures(const APIPermissionSet& api_permissions,
+bool Extension::LoadExtensionFeatures(APIPermissionSet& api_permissions,
string16* error) {
if (manifest_->HasKey(keys::kConvertedFromUserScript))
manifest_->GetBoolean(keys::kConvertedFromUserScript,
@@ -2197,6 +2197,7 @@ bool Extension::LoadExtensionFeatures(const APIPermissionSet& api_permissions,
!LoadContentScripts(error) ||
!LoadPageAction(error) ||
!LoadBrowserAction(error) ||
+ !LoadSystemIndicator(api_permissions, error) ||
!LoadScriptBadge(error) ||
!LoadFileBrowserHandlers(error) ||
!LoadChromeURLOverrides(error) ||
@@ -2443,6 +2444,26 @@ bool Extension::LoadBrowserAction(string16* error) {
return true;
}
+bool Extension::LoadSystemIndicator(APIPermissionSet& api_permissions,
+ string16* error) {
+ if (!manifest_->HasKey(keys::kSystemIndicator)) {
+ return true;
+ }
+
+ DictionaryValue* system_indicator_value = NULL;
+ if (!manifest_->GetDictionary(keys::kSystemIndicator,
+ &system_indicator_value)) {
+ *error = ASCIIToUTF16(errors::kInvalidSystemIndicator);
+ return false;
+ }
+
+ // Because the manifest was successfully parsed, auto-grant the permission.
+ api_permissions.insert(APIPermission::kSystemIndicator);
not at google - send to devlin 2012/11/20 23:58:08 I like this idea. We should make it happen for all
dewittj 2012/11/21 22:09:41 Will add to the rest of the _actions in a separate
not at google - send to devlin 2012/11/21 23:39:23 Ok. The status of the Feature system is partially
+
+ // TODO(dewittj) Parse browser action section.
+ return true;
not at google - send to devlin 2012/11/20 23:58:08 Why not just implement it now?
dewittj 2012/11/21 22:09:41 I still have doubts about what the final format wi
not at google - send to devlin 2012/11/21 23:39:23 Yep sounds good, but I hope that any improvements
+}
+
bool Extension::LoadScriptBadge(string16* error) {
if (manifest_->HasKey(keys::kScriptBadge)) {
if (!FeatureSwitch::script_badges()->IsEnabled()) {

Powered by Google App Engine
This is Rietveld 408576698