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

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

Issue 7134035: Make an inserted selected tab selected before calling TabInsertedAt on observers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename selected to active Created 9 years, 6 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
diff --git a/chrome/browser/extensions/extension_browser_event_router.cc b/chrome/browser/extensions/extension_browser_event_router.cc
index 2e54caaae0b1dace3557173693d0ea49cf20f820..905b799a4e0bb121bdc1d27cf2302961db0356c4 100644
--- a/chrome/browser/extensions/extension_browser_event_router.cc
+++ b/chrome/browser/extensions/extension_browser_event_router.cc
@@ -217,7 +217,7 @@ void ExtensionBrowserEventRouter::TabCreatedAt(TabContents* contents,
int index,
bool foreground) {
DispatchEventWithTab(contents->profile(), "", events::kOnTabCreated,
- contents);
+ contents, foreground);
sky 2011/06/10 14:58:59 foreground->active
RegisterForTabNotifications(contents);
}
@@ -386,12 +386,14 @@ void ExtensionBrowserEventRouter::DispatchEventWithTab(
Profile* profile,
const std::string& extension_id,
const char* event_name,
- const TabContents* tab_contents) {
+ const TabContents* tab_contents,
+ bool foreground) {
sky 2011/06/10 14:58:59 foreground -> active
if (!profile_->IsSameProfile(profile))
return;
ListValue args;
- args.Append(ExtensionTabUtil::CreateTabValue(tab_contents));
+ args.Append(ExtensionTabUtil::CreateTabValueActive(
+ tab_contents, foreground));
std::string json_args;
base::JSONWriter::Write(&args, false, &json_args);
if (!extension_id.empty()) {
@@ -543,7 +545,7 @@ void ExtensionBrowserEventRouter::PageActionExecuted(
return;
}
DispatchEventWithTab(profile, extension_id, "pageAction.onClicked",
- tab_contents->tab_contents());
+ tab_contents->tab_contents(), true);
}
void ExtensionBrowserEventRouter::BrowserActionExecuted(
@@ -553,5 +555,5 @@ void ExtensionBrowserEventRouter::BrowserActionExecuted(
if (!ExtensionTabUtil::GetDefaultTab(browser, &tab_contents, &tab_id))
return;
DispatchEventWithTab(profile, extension_id, "browserAction.onClicked",
- tab_contents->tab_contents());
+ tab_contents->tab_contents(), true);
}

Powered by Google App Engine
This is Rietveld 408576698