summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_browser_event_router.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-23 15:57:16 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-23 15:57:16 +0000
commitd964a82f353e43a4518402daeeed4c7c260d208e (patch)
treef58f0a720ab2dbe7dbfb49400793c59e8fa1a75d /chrome/browser/extensions/extension_browser_event_router.cc
parent46b9df684dc4b87255f8ad11fbde4131229a3544 (diff)
downloadchromium_src-d964a82f353e43a4518402daeeed4c7c260d208e.zip
chromium_src-d964a82f353e43a4518402daeeed4c7c260d208e.tar.gz
chromium_src-d964a82f353e43a4518402daeeed4c7c260d208e.tar.bz2
Make NetworkProfileBubble not use BrowserList::GetLastActive() as much. Instead pass it a profile and a PageNavigator. This also required me to make BrowserList::Observer methods take a non-const Browser*. It was pretty silly they were const to begin with, since you pretty much only ever get a Browser* to do something to it.
http://crbug.com/129187 TEST=none Review URL: https://chromiumcodereview.appspot.com/10388239 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138486 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_browser_event_router.cc')
-rw-r--r--chrome/browser/extensions/extension_browser_event_router.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc
index 8be4717..dfae9ec 100644
--- a/chrome/browser/extensions/extension_browser_event_router.cc
+++ b/chrome/browser/extensions/extension_browser_event_router.cc
@@ -126,12 +126,12 @@ ExtensionBrowserEventRouter::~ExtensionBrowserEventRouter() {
#endif
}
-void ExtensionBrowserEventRouter::OnBrowserAdded(const Browser* browser) {
+void ExtensionBrowserEventRouter::OnBrowserAdded(Browser* browser) {
RegisterForBrowserNotifications(browser);
}
void ExtensionBrowserEventRouter::RegisterForBrowserNotifications(
- const Browser* browser) {
+ Browser* browser) {
if (!profile_->IsSameProfile(browser->profile()))
return;
// Start listening to TabStripModel events for this browser.
@@ -141,7 +141,7 @@ void ExtensionBrowserEventRouter::RegisterForBrowserNotifications(
// notified when it is. If this is an existing window, this is a no-op that we
// just do to reduce code complexity.
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY,
- content::Source<const Browser>(browser));
+ content::Source<Browser>(browser));
for (int i = 0; i < browser->tab_strip_model()->count(); ++i) {
RegisterForTabNotifications(
@@ -171,7 +171,7 @@ void ExtensionBrowserEventRouter::UnregisterForTabNotifications(
content::Source<WebContents>(contents));
}
-void ExtensionBrowserEventRouter::OnBrowserWindowReady(const Browser* browser) {
+void ExtensionBrowserEventRouter::OnBrowserWindowReady(Browser* browser) {
ListValue args;
DCHECK(browser->extension_window_controller());
@@ -185,7 +185,7 @@ void ExtensionBrowserEventRouter::OnBrowserWindowReady(const Browser* browser) {
DispatchEvent(browser->profile(), events::kOnWindowCreated, json_args);
}
-void ExtensionBrowserEventRouter::OnBrowserRemoved(const Browser* browser) {
+void ExtensionBrowserEventRouter::OnBrowserRemoved(Browser* browser) {
if (!profile_->IsSameProfile(browser->profile()))
return;
@@ -193,7 +193,7 @@ void ExtensionBrowserEventRouter::OnBrowserRemoved(const Browser* browser) {
browser->tab_strip_model()->RemoveObserver(this);
registrar_.Remove(this, chrome::NOTIFICATION_BROWSER_WINDOW_READY,
- content::Source<const Browser>(browser));
+ content::Source<Browser>(browser));
DispatchSimpleBrowserEvent(browser->profile(),
ExtensionTabUtil::GetWindowId(browser),
@@ -216,7 +216,7 @@ void ExtensionBrowserEventRouter::ActiveWindowChanged(
#endif
void ExtensionBrowserEventRouter::OnBrowserSetLastActive(
- const Browser* browser) {
+ Browser* browser) {
Profile* window_profile = NULL;
int window_id = extension_misc::kUnknownWindowId;
if (browser && profile_->IsSameProfile(browser->profile())) {
@@ -565,7 +565,7 @@ void ExtensionBrowserEventRouter::Observe(
registrar_.Remove(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
content::Source<WebContents>(contents));
} else if (type == chrome::NOTIFICATION_BROWSER_WINDOW_READY) {
- const Browser* browser = content::Source<const Browser>(source).ptr();
+ Browser* browser = content::Source<Browser>(source).ptr();
OnBrowserWindowReady(browser);
#if defined(OS_MACOSX)
} else if (type == content::NOTIFICATION_NO_KEY_WINDOW) {