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

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

Issue 11364196: Remove TabContents from TabStripModelObserver::ActiveTabChanged. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 1 month 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/browser_event_router.cc
diff --git a/chrome/browser/extensions/browser_event_router.cc b/chrome/browser/extensions/browser_event_router.cc
index 5c42f4a70952bd681fa78d35e68d2a5821fab2a4..979d00d4da41fbc3c2aa2f9879c9e8a9f74ca6e1 100644
--- a/chrome/browser/extensions/browser_event_router.cc
+++ b/chrome/browser/extensions/browser_event_router.cc
@@ -250,22 +250,23 @@ void BrowserEventRouter::TabClosingAt(TabStripModel* tab_strip_model,
UnregisterForTabNotifications(contents);
}
-void BrowserEventRouter::ActiveTabChanged(TabContents* old_contents,
- TabContents* new_contents,
+void BrowserEventRouter::ActiveTabChanged(WebContents* old_contents,
+ WebContents* new_contents,
int index,
bool user_gesture) {
scoped_ptr<ListValue> args(new ListValue());
- int tab_id = ExtensionTabUtil::GetTabId(new_contents->web_contents());
+ int tab_id = ExtensionTabUtil::GetTabId(new_contents);
args->Append(Value::CreateIntegerValue(tab_id));
DictionaryValue* object_args = new DictionaryValue();
object_args->Set(tab_keys::kWindowIdKey, Value::CreateIntegerValue(
- ExtensionTabUtil::GetWindowIdOfTab(new_contents->web_contents())));
+ ExtensionTabUtil::GetWindowIdOfTab(new_contents)));
args->Append(object_args);
// The onActivated event replaced onActiveChanged and onSelectionChanged. The
// deprecated events take two arguments: tabId, {windowId}.
- Profile* profile = new_contents->profile();
+ Profile* profile =
+ Profile::FromBrowserContext(new_contents->GetBrowserContext());
EventRouter::UserGestureState gesture = user_gesture ?
EventRouter::USER_GESTURE_ENABLED : EventRouter::USER_GESTURE_NOT_ENABLED;
DispatchEvent(profile, events::kOnTabSelectionChanged,
« no previous file with comments | « chrome/browser/extensions/browser_event_router.h ('k') | chrome/browser/ui/ash/launcher/browser_launcher_item_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698