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

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

Issue 1363463002: [Extensions Toolbar] Add a finch config for the redesign (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finnur's Created 5 years, 3 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 f32d633697e39672cbea55f969f1fd45babb047f..89af53a53f7a6d39e2987b33b5e69d7cfe9995d6 100644
--- a/chrome/browser/extensions/location_bar_controller.cc
+++ b/chrome/browser/extensions/location_bar_controller.cc
@@ -30,8 +30,7 @@ LocationBarController::LocationBarController(
should_show_page_actions_(
!FeatureSwitch::extension_action_redesign()->IsEnabled()),
extension_registry_observer_(this) {
- if (should_show_page_actions_)
- extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
+ extension_registry_observer_.Add(ExtensionRegistry::Get(browser_context_));
}
LocationBarController::~LocationBarController() {
@@ -93,7 +92,7 @@ std::vector<ExtensionAction*> LocationBarController::GetCurrentActions() {
void LocationBarController::OnExtensionLoaded(
content::BrowserContext* browser_context,
const Extension* extension) {
- if (action_manager_->GetPageAction(*extension)) {
+ if (should_show_page_actions_ && action_manager_->GetPageAction(*extension)) {
ExtensionActionAPI::Get(browser_context)->
NotifyPageActionsChanged(web_contents_);
}
@@ -122,7 +121,7 @@ void LocationBarController::OnExtensionUnloaded(
content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionInfo::Reason reason) {
- if (action_manager_->GetPageAction(*extension)) {
+ if (should_show_page_actions_ && action_manager_->GetPageAction(*extension)) {
ExtensionActionAPI::Get(browser_context)->
NotifyPageActionsChanged(web_contents_);
}

Powered by Google App Engine
This is Rietveld 408576698