Chromium Code Reviews| 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); |
| } |