diff options
| author | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-18 20:39:51 +0000 |
|---|---|---|
| committer | kalman@chromium.org <kalman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-18 20:39:51 +0000 |
| commit | 3a36243cac7dbb5d700b25d3d51736895b4388f0 (patch) | |
| tree | 75e54ec7afd22066c56b5c1fb48ba40b1c13770e | |
| parent | 47d1a47a5af989e191ef0eccf314c8f1e02c5a43 (diff) | |
| download | chromium_src-3a36243cac7dbb5d700b25d3d51736895b4388f0.zip chromium_src-3a36243cac7dbb5d700b25d3d51736895b4388f0.tar.gz chromium_src-3a36243cac7dbb5d700b25d3d51736895b4388f0.tar.bz2 | |
Add a new --enable-script-badges flag and use that rather than --enable-action-box
where appropriate. Also remove the behaviour where page actions are turned into
browser actions (just swallow them).
Review URL: https://chromiumcodereview.appspot.com/10544190
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142800 0039d316-1c4b-4281-b951-d872f2087c98
| -rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
| -rw-r--r-- | chrome/browser/about_flags.cc | 7 | ||||
| -rw-r--r-- | chrome/browser/extensions/api/extension_action/extension_actions_api.cc | 6 | ||||
| -rw-r--r-- | chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc | 2 | ||||
| -rw-r--r-- | chrome/browser/extensions/extension_tab_helper.cc | 2 | ||||
| -rw-r--r-- | chrome/common/chrome_switches.cc | 3 | ||||
| -rw-r--r-- | chrome/common/chrome_switches.h | 3 | ||||
| -rw-r--r-- | chrome/common/extensions/extension.cc | 2 | ||||
| -rw-r--r-- | chrome/common/extensions/extension_switch_utils.cc | 5 | ||||
| -rw-r--r-- | chrome/common/extensions/extension_switch_utils.h | 2 |
10 files changed, 31 insertions, 7 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 3373f42..2547da3 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -5370,6 +5370,12 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_FLAGS_ACTION_BOX_DESCRIPTION" desc="Description of the 'Action Box' lab."> Enables the "Action Box" experimental toolbar UI. </message> + <message name="IDS_FLAGS_SCRIPT_BADGES_NAME" desc="Name of the 'Script Badges' lab."> + Script badges + </message> + <message name="IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION" desc="Description of the 'Script Badges' lab."> + Shows extension "script badges" in the location bar rather than page actions. + </message> <message name="IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME" desc="Name of the 'New Apps Install Bubble' lab"> New Apps Install Bubble </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 5322cef..26186bb 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -340,6 +340,13 @@ const Experiment kExperiments[] = { SINGLE_VALUE_TYPE(switches::kEnableActionBox), }, { + "script-badges", + IDS_FLAGS_SCRIPT_BADGES_NAME, + IDS_FLAGS_SCRIPT_BADGES_DESCRIPTION, + kOsAll, + SINGLE_VALUE_TYPE(switches::kEnableScriptBadges), + }, + { "apps-new-install-bubble", IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_NAME, IDS_FLAGS_APPS_NEW_INSTALL_BUBBLE_DESCRIPTION, diff --git a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc index f5d0791..20fb27f 100644 --- a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc +++ b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc @@ -164,8 +164,8 @@ bool ExtensionActionFunction::ParseCSSColorString( } bool ExtensionActionFunction::SetVisible(bool visible) { - // If --enable-action-box is on there will be a browser_action here instead - // of a page action. Until we decide what to do with that, just ignore. + // If --enable-script-badges is on there will be a browser_action here + // instead of a page action. Disable/renable the browser action perhaps? if (!GetExtension()->page_action()) return true; extension_action_->SetIsVisible(tab_id_, visible); @@ -194,7 +194,7 @@ bool ExtensionActionSetIconFunction::RunExtensionAction() { IPC::ReadParam(&bitmap_pickle, &iter, &bitmap)); extension_action_->SetIcon(tab_id_, bitmap); } else if (details_->GetInteger("iconIndex", &icon_index)) { - // If --enable-action-box is on there might legitimately be an iconIndex + // If --enable-script-badges is on there might legitimately be an iconIndex // set. Until we decide what to do with that, ignore. if (!GetExtension()->page_action()) return true; diff --git a/chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc b/chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc index 073138a..afb8ca1 100644 --- a/chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc +++ b/chrome/browser/extensions/api/extension_action/page_as_browser_action_apitest.cc @@ -35,7 +35,7 @@ class PageAsBrowserActionApiTest : public ExtensionApiTest { void SetUpCommandLine(CommandLine* command_line) OVERRIDE { ExtensionApiTest::SetUpCommandLine(command_line); - command_line->AppendSwitch(switches::kEnableActionBox); + command_line->AppendSwitch(switches::kEnableScriptBadges); } protected: diff --git a/chrome/browser/extensions/extension_tab_helper.cc b/chrome/browser/extensions/extension_tab_helper.cc index 2e4682f..2304299 100644 --- a/chrome/browser/extensions/extension_tab_helper.cc +++ b/chrome/browser/extensions/extension_tab_helper.cc @@ -51,7 +51,7 @@ ExtensionTabHelper::ExtensionTabHelper(TabContents* tab_contents) extension_function_dispatcher_(tab_contents->profile(), this)), tab_contents_(tab_contents), active_tab_permission_manager_(tab_contents) { - if (extensions::switch_utils::IsActionBoxEnabled()) { + if (extensions::switch_utils::AreScriptBadgesEnabled()) { script_badge_controller_ = new ScriptBadgeController(tab_contents); } else { script_executor_.reset( diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 901f4d9..4aa9159 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -604,6 +604,9 @@ const char kEnablePnacl[] = "enable-pnacl"; // during chrome_browser_main. const char kEnableProfiling[] = "enable-profiling"; +// Enables extension scripts badges in the location bar. +const char kEnableScriptBadges[] = "enable-script-badges"; + // Controls the support for SDCH filtering (dictionary based expansion of // content). By default SDCH filtering is enabled. To disable SDCH filtering, // use "--enable-sdch=0" as command line argument. SDCH is currently only diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 98a0b5a..d91fda4 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -164,6 +164,7 @@ extern const char kEnableNaClDebug[]; extern const char kEnableNaClExceptionHandling[]; extern const char kEnableNaClIPCProxy[]; extern const char kEnableNpn[]; +extern const char kDisableSyncTabs[]; extern const char kEnableNpnHttpOnly[]; extern const char kEnablePanels[]; extern const char kEnablePasswordGeneration[]; @@ -171,12 +172,12 @@ extern const char kEnablePlatformApps[]; extern const char kEnablePnacl[]; extern const char kEnableProfiling[]; extern const char kEnableResourceContentSettings[]; +extern const char kEnableScriptBadges[]; extern const char kEnableSdch[]; extern const char kEnableSpdy3[]; extern const char kEnableSpdyFlowControl[]; extern const char kEnableStackedTabStrip[]; extern const char kEnableSuggestionsTabPage[]; -extern const char kDisableSyncTabs[]; extern const char kEnableTabGroupsContextMenu[]; extern const char kEnableWatchdog[]; extern const char kEnableWebsiteSettings[]; diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 7db7ca6..c36402c 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -2253,7 +2253,7 @@ bool Extension::LoadPageAction(string16* error) { // The action box changes the meaning of the page action area, so we need // to convert page actions into browser actions. - if (switch_utils::IsActionBoxEnabled()) { + if (switch_utils::AreScriptBadgesEnabled()) { browser_action_ = page_action_.Pass(); // declared_action_type_ stays the same; that's the point. } diff --git a/chrome/common/extensions/extension_switch_utils.cc b/chrome/common/extensions/extension_switch_utils.cc index 6f9d00c..8b41231 100644 --- a/chrome/common/extensions/extension_switch_utils.cc +++ b/chrome/common/extensions/extension_switch_utils.cc @@ -27,6 +27,11 @@ bool IsActionBoxEnabled() { switches::kEnableActionBox); } +bool AreScriptBadgesEnabled() { + return CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableScriptBadges); +} + } // switch_utils } // extensions diff --git a/chrome/common/extensions/extension_switch_utils.h b/chrome/common/extensions/extension_switch_utils.h index e2c53ca..e5e095c 100644 --- a/chrome/common/extensions/extension_switch_utils.h +++ b/chrome/common/extensions/extension_switch_utils.h @@ -14,6 +14,8 @@ bool IsEasyOffStoreInstallEnabled(); bool IsActionBoxEnabled(); +bool AreScriptBadgesEnabled(); + } // switch_utils } // extensions |
