Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1111)

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

Issue 73065: Initial plumbing for sending events from the browser to extension renderers. ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.h ('k') | chrome/browser/extensions/extensions_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_tabs_module.cc
===================================================================
--- chrome/browser/extensions/extension_tabs_module.cc (revision 13816)
+++ chrome/browser/extensions/extension_tabs_module.cc (working copy)
@@ -17,6 +17,14 @@
static bool GetIndexOfTabId(const TabStripModel* tab_strip, int tab_id,
int* tab_index);
+int ExtensionTabUtil::GetTabId(const TabContents* tab_contents) {
+ return tab_contents->controller()->session_id().id();
+}
+
+int ExtensionTabUtil::GetWindowIdOfTab(const TabContents* tab_contents) {
+ return tab_contents->controller()->window_id().id();
+}
+
bool GetTabsForWindowFunction::RunImpl() {
if (!args_->IsType(Value::TYPE_NULL))
return false;
@@ -198,9 +206,9 @@
DCHECK(controller); // TODO(aa): Is this a valid assumption?
DictionaryValue* result = new DictionaryValue();
- result->SetInteger(L"id", controller->session_id().id());
+ result->SetInteger(L"id", ExtensionTabUtil::GetTabId(contents));
result->SetInteger(L"index", tab_index);
- result->SetInteger(L"windowId", controller->window_id().id());
+ result->SetInteger(L"windowId", ExtensionTabUtil::GetWindowIdOfTab(contents));
result->SetString(L"url", contents->GetURL().spec());
result->SetString(L"title", UTF16ToWide(contents->GetTitle()));
result->SetBoolean(L"selected", tab_index == tab_strip->selected_index());
« no previous file with comments | « chrome/browser/extensions/extension_tabs_module.h ('k') | chrome/browser/extensions/extensions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698