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( |