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 21aa37787ee701ed5cefa43abcb7512af9e0af4d..24b5c33d7d6dec07113f07e9916d1a2d1778f214 100644 |
--- a/chrome/browser/extensions/location_bar_controller.cc |
+++ b/chrome/browser/extensions/location_bar_controller.cc |
@@ -6,18 +6,12 @@ |
#include "base/logging.h" |
#include "chrome/browser/extensions/active_script_controller.h" |
+#include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
#include "chrome/browser/extensions/page_action_controller.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/api/extension_action/action_info.h" |
-#include "content/public/browser/invalidate_type.h" |
#include "content/public/browser/navigation_details.h" |
-#include "content/public/browser/notification_service.h" |
-#include "content/public/browser/notification_source.h" |
#include "content/public/browser/web_contents.h" |
#include "extensions/browser/extension_registry.h" |
-#include "extensions/browser/notification_types.h" |
namespace extensions { |
@@ -57,23 +51,6 @@ std::vector<ExtensionAction*> LocationBarController::GetCurrentActions() { |
return current_actions; |
} |
-// static |
-void LocationBarController::NotifyChange(content::WebContents* web_contents) { |
- Browser* browser = chrome::FindBrowserWithWebContents(web_contents); |
- if (!browser) |
- return; |
- LocationBar* location_bar = |
- browser->window() ? browser->window()->GetLocationBar() : NULL; |
- if (!location_bar) |
- return; |
- location_bar->UpdatePageActions(); |
- |
- content::NotificationService::current()->Notify( |
- NOTIFICATION_EXTENSION_PAGE_ACTIONS_UPDATED, |
- content::Source<content::WebContents>(web_contents), |
- content::NotificationService::NoDetails()); |
-} |
- |
void LocationBarController::DidNavigateMainFrame( |
const content::LoadCommittedDetails& details, |
const content::FrameNavigateParams& params) { |
@@ -98,8 +75,10 @@ void LocationBarController::OnExtensionUnloaded( |
should_update = true; |
} |
- if (should_update) |
- NotifyChange(web_contents()); |
+ if (should_update) { |
+ ExtensionActionAPI::Get(browser_context)-> |
+ NotifyPageActionsChanged(web_contents()); |
+ } |
} |
} // namespace extensions |