summaryrefslogtreecommitdiffstats
path: root/extensions/common/extension.cc
diff options
context:
space:
mode:
authorrdevlin.cronin <rdevlin.cronin@chromium.org>2015-02-17 10:59:16 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-17 19:00:25 +0000
commitfcc1e54ddde55b158cc7addd46d1cd59b2bce577 (patch)
tree6585e2a28c889b4248751813a21f1dd21c072a1c /extensions/common/extension.cc
parent16a2077e04314ebc536e28b689e8fb07bb2c6276 (diff)
downloadchromium_src-fcc1e54ddde55b158cc7addd46d1cd59b2bce577.zip
chromium_src-fcc1e54ddde55b158cc7addd46d1cd59b2bce577.tar.gz
chromium_src-fcc1e54ddde55b158cc7addd46d1cd59b2bce577.tar.bz2
[Extensions Toolbar] Have all extensions in the toolbar show a context menu
Previously, we never showed context menus for component extensions, but this just looks weird when it's in the browser actions toolbar. Give component extensions a context menu if the redesign is on. BUG=428996 Review URL: https://codereview.chromium.org/919733002 Cr-Commit-Position: refs/heads/master@{#316617}
Diffstat (limited to 'extensions/common/extension.cc')
-rw-r--r--extensions/common/extension.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
index b721406..1e973fc 100644
--- a/extensions/common/extension.cc
+++ b/extensions/common/extension.cc
@@ -24,6 +24,7 @@
#include "content/public/common/url_constants.h"
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
+#include "extensions/common/feature_switch.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handler.h"
@@ -271,12 +272,15 @@ GURL Extension::GetBaseURLFromExtensionId(const std::string& extension_id) {
}
bool Extension::ShowConfigureContextMenus() const {
- // Don't show context menu for component extensions. We might want to show
- // options for component extension button but now there is no component
- // extension with options. All other menu items like uninstall have
- // no sense for component extensions.
- return location() != Manifest::COMPONENT &&
- location() != Manifest::EXTERNAL_COMPONENT;
+ // Normally we don't show a context menu for component actions, but when
+ // re-design is enabled we show them in the toolbar (if they have an action),
+ // and it is weird to have a random button that has no context menu when the
+ // rest do.
+ if (location() == Manifest::COMPONENT ||
+ location() == Manifest::EXTERNAL_COMPONENT)
+ return FeatureSwitch::extension_action_redesign()->IsEnabled();
+
+ return true;
}
bool Extension::OverlapsWithOrigin(const GURL& origin) const {