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

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

Issue 540483002: Fix regression in showing bookmark star when an extension should override it (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Peter's Created 6 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 488983f53127621b00b3662d8b56da26f9d352b9..5d9b1ba32b0c81c2b2878ff9a3beb6de004feb10 100644
--- a/chrome/browser/extensions/location_bar_controller.cc
+++ b/chrome/browser/extensions/location_bar_controller.cc
@@ -7,6 +7,11 @@
#include "chrome/browser/extensions/active_script_controller.h"
#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
#include "chrome/browser/extensions/extension_action_manager.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_finder.h"
+#include "chrome/browser/ui/browser_window.h"
+#include "chrome/browser/ui/location_bar/location_bar.h"
+#include "chrome/common/extensions/manifest_handlers/ui_overrides_handler.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/feature_switch.h"
@@ -60,6 +65,19 @@ void LocationBarController::OnExtensionLoaded(
ExtensionActionAPI::Get(browser_context)->
NotifyPageActionsChanged(web_contents_);
}
+
+ // We might also need to update the location bar if the extension can remove
+ // the bookmark star.
+ if (UIOverrides::RemovesBookmarkButton(extension)) {
+ Browser* browser = chrome::FindBrowserWithWebContents(web_contents_);
+ if (!browser)
+ return;
+ LocationBar* location_bar =
+ browser->window() ? browser->window()->GetLocationBar() : NULL;
+ if (!location_bar)
+ return;
+ location_bar->UpdateBookmarkStarVisibility();
+ }
}
void LocationBarController::OnExtensionUnloaded(

Powered by Google App Engine
This is Rietveld 408576698