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

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

Issue 10388239: Make NetworkProfileBubble not use BrowserList::GetLastActive() as much. Instead pass it a profile a… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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/extension_browser_event_router.cc
===================================================================
--- chrome/browser/extensions/extension_browser_event_router.cc (revision 138102)
+++ chrome/browser/extensions/extension_browser_event_router.cc (working copy)
@@ -126,12 +126,12 @@
#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 @@
// 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 @@
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 @@
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 @@
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 @@
#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 @@
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) {

Powered by Google App Engine
This is Rietveld 408576698