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

Unified Diff: chrome/browser/extensions/location_bar_controller.cc

Issue 516633002: Stop showing page actions in the location bar with redesign enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
Index: chrome/browser/extensions/location_bar_controller.cc
diff --git a/chrome/browser/extensions/location_bar_controller.cc b/chrome/browser/extensions/location_bar_controller.cc
index 12ad8dba73f66c676cfc8c47d7dfcc9c53773ace..e0be5d9db014027a0b5de649d3c227dafcc6319d 100644
--- a/chrome/browser/extensions/location_bar_controller.cc
+++ b/chrome/browser/extensions/location_bar_controller.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/extensions/extension_action_manager.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
+#include "extensions/common/feature_switch.h"
namespace extensions {
@@ -16,9 +17,12 @@ LocationBarController::LocationBarController(
content::WebContents* web_contents)
: web_contents_(web_contents),
browser_context_(web_contents->GetBrowserContext()),
+ should_show_page_actions_(
+ !FeatureSwitch::extension_action_redesign()->IsEnabled()),
active_script_controller_(new ActiveScriptController(web_contents_)),
extension_registry_observer_(this) {
- extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
+ if (should_show_page_actions_)
+ extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
}
LocationBarController::~LocationBarController() {
@@ -30,6 +34,9 @@ std::vector<ExtensionAction*> LocationBarController::GetCurrentActions() {
ExtensionActionManager* action_manager =
ExtensionActionManager::Get(browser_context_);
std::vector<ExtensionAction*> current_actions;
+ if (!should_show_page_actions_)
+ return current_actions;
+
for (ExtensionSet::const_iterator iter = extensions.begin();
iter != extensions.end();
++iter) {

Powered by Google App Engine
This is Rietveld 408576698