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

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

Issue 12618009: Move SystemIndicator parsing out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 9 months 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
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/manifest_handler_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension.cc
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index ac7816db702c1f9dd896a3a1a55cd4f8719ba31a..7a200106c8f342c6dea99c52c14bd024318777b3 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -34,6 +34,7 @@
#include "chrome/common/extensions/background_info.h"
#include "chrome/common/extensions/csp_handler.h"
#include "chrome/common/extensions/csp_validator.h"
+#include "chrome/common/extensions/extension_icon_set.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/feature_switch.h"
#include "chrome/common/extensions/features/base_feature_provider.h"
@@ -167,18 +168,6 @@ bool ContainsManifestForbiddenPermission(const APIPermissionSet& apis,
return false;
}
-// Helper method to load an ExtensionAction from the page_action, script_badge,
-// browser_action, or system_indicator entries in the manifest.
-// TODO(rdevlin.cronin): Remove this once PageAction, BrowserAction, and
-// SystemIndicator have been moved out of Extension.
-scoped_ptr<ActionInfo> LoadExtensionActionInfoHelper(
- const Extension* extension,
- const DictionaryValue* extension_action,
- string16* error) {
- return manifest_handler_helpers::LoadActionInfo(
- extension, extension_action, error);
-}
-
} // namespace
#if defined(OS_WIN)
@@ -1313,8 +1302,9 @@ bool Extension::InitFromValue(int flags, string16* error) {
if (!LoadSharedFeatures(error))
return false;
- if (!LoadExtensionFeatures(error))
- return false;
+ if (manifest_->HasKey(keys::kConvertedFromUserScript))
+ manifest_->GetBoolean(keys::kConvertedFromUserScript,
+ &converted_from_user_script_);
if (!LoadManagedModeFeatures(error))
return false;
@@ -1913,41 +1903,6 @@ bool Extension::LoadOfflineEnabled(string16* error) {
return true;
}
-bool Extension::LoadExtensionFeatures(string16* error) {
- if (manifest_->HasKey(keys::kConvertedFromUserScript))
- manifest_->GetBoolean(keys::kConvertedFromUserScript,
- &converted_from_user_script_);
-
- return LoadSystemIndicator(error);
-}
-
-bool Extension::LoadSystemIndicator(string16* error) {
- if (!manifest_->HasKey(keys::kSystemIndicator)) {
- // There was no manifest entry for the system indicator.
- return true;
- }
-
- const DictionaryValue* system_indicator_value = NULL;
- if (!manifest_->GetDictionary(keys::kSystemIndicator,
- &system_indicator_value)) {
- *error = ASCIIToUTF16(errors::kInvalidSystemIndicator);
- return false;
- }
-
- system_indicator_info_ = LoadExtensionActionInfoHelper(
- this, system_indicator_value, error);
-
- if (!system_indicator_info_.get()) {
- return false;
- }
-
- // Because the manifest was successfully parsed, auto-grant the permission.
- // TODO(dewittj) Add this for all extension action APIs.
- initial_api_permissions()->insert(APIPermission::kSystemIndicator);
-
- return true;
-}
-
bool Extension::HasMultipleUISurfaces() const {
int num_surfaces = 0;
« no previous file with comments | « chrome/common/extensions/extension.h ('k') | chrome/common/extensions/manifest_handler_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698