summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorerikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-07 00:40:19 +0000
committererikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-07 00:40:19 +0000
commitea99c3abb5ad6121d94a4c4cf1ca683d4f0ebd90 (patch)
tree1f76dcfcd0c77659ff28c18ca271fbcd0bdec936 /chrome/common
parent7467340a80a0dce12fcaae5d5fc62ec56131b8bb (diff)
downloadchromium_src-ea99c3abb5ad6121d94a4c4cf1ca683d4f0ebd90.zip
chromium_src-ea99c3abb5ad6121d94a4c4cf1ca683d4f0ebd90.tar.gz
chromium_src-ea99c3abb5ad6121d94a4c4cf1ca683d4f0ebd90.tar.bz2
Fix issue where we weren't requiring the command-line flag for
experimental API use and weren't requiring that it be declared in the manifest. BUG=31537 TEST=none Review URL: http://codereview.chromium.org/526011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/extensions/extension.cc20
-rw-r--r--chrome/common/extensions/extension.h4
2 files changed, 11 insertions, 13 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 5dfdf1c..1ccaeec 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -61,15 +61,15 @@ static void ConvertHexadecimalToIDAlphabet(std::string* id) {
// Returns true if the given string is an API permission (see kPermissionNames).
static bool IsAPIPermission(const std::string& str) {
for (size_t i = 0; i < Extension::kNumPermissions; ++i) {
- if (str == Extension::kPermissionNames[i])
+ if (str == Extension::kPermissionNames[i]) {
+ if (str == Extension::kExperimentalPermission &&
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExperimentalExtensionApis)) {
+ return false;
+ }
return true;
+ }
}
-
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableExperimentalExtensionApis) &&
- str == Extension::kExperimentalName)
- return true;
-
return false;
}
@@ -116,17 +116,17 @@ const int Extension::kBrowserActionIconMaxSize = 19;
const char* Extension::kTabPermission = "tabs";
const char* Extension::kBookmarkPermission = "bookmarks";
const char* Extension::kNotificationPermission = "notifications";
+const char* Extension::kExperimentalPermission = "experimental";
const char* Extension::kPermissionNames[] = {
Extension::kTabPermission,
Extension::kBookmarkPermission,
- Extension::kNotificationPermission
+ Extension::kNotificationPermission,
+ Extension::kExperimentalPermission
};
const size_t Extension::kNumPermissions =
arraysize(Extension::kPermissionNames);
-const char* Extension::kExperimentalName = "experimental";
-
Extension::~Extension() {
}
diff --git a/chrome/common/extensions/extension.h b/chrome/common/extensions/extension.h
index 9906aea..b1e1b69 100644
--- a/chrome/common/extensions/extension.h
+++ b/chrome/common/extensions/extension.h
@@ -73,13 +73,11 @@ class Extension {
static const char* kTabPermission;
static const char* kBookmarkPermission;
static const char* kNotificationPermission;
+ static const char* kExperimentalPermission;
static const char* kPermissionNames[];
static const size_t kNumPermissions;
- // Experimental extension APIs are guarded by the following flag.
- static const char* kExperimentalName;
-
struct PrivacyBlacklistInfo {
FilePath path; // Path to the plain-text blacklist.
};