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

Unified Diff: extensions/common/extension.cc

Issue 919733002: [Extensions Toolbar] Have all extensions in the toolbar show a context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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/browser/extensions/extension_context_menu_model_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/extension.cc
diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
index b721406701d0732e6fd83eec12798d41024cb329..1e973fccc82b2e57b533dae0168271be8fa4a3b9 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 {
« no previous file with comments | « chrome/browser/extensions/extension_context_menu_model_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698