Index: chrome/browser/automation/testing_automation_provider.cc |
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc |
index 6e718cb79e487ceefef9784813f3102762a6a47b..693eaa78e00f0e08618e961c5aa30cce1e23e50c 100644 |
--- a/chrome/browser/automation/testing_automation_provider.cc |
+++ b/chrome/browser/automation/testing_automation_provider.cc |
@@ -398,6 +398,8 @@ bool TestingAutomationProvider::OnMessageReceived( |
IPC_MESSAGE_HANDLER_DELAY_REPLY( |
AutomationMsg_WaitForProcessLauncherThreadToGoIdle, |
WaitForProcessLauncherThreadToGoIdle) |
+ IPC_MESSAGE_HANDLER(AutomationMsg_GetParentBrowserOfTab, |
+ GetParentBrowserOfTab) |
IPC_MESSAGE_UNHANDLED( |
handled = AutomationProvider::OnMessageReceived(message)) |
@@ -4616,6 +4618,18 @@ void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( |
new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); |
} |
+void TestingAutomationProvider::GetParentBrowserOfTab(int tab_handle, |
+ int* browser_handle) { |
+ *browser_handle = 0; |
Paweł Hajdan Jr.
2011/02/15 08:50:14
Generally automation client is expected to know th
|
+ if (tab_tracker_->ContainsHandle(tab_handle)) { |
+ NavigationController* controller = tab_tracker_->GetResource(tab_handle); |
+ int index; |
+ Browser* browser = Browser::GetBrowserForController(controller, &index); |
+ if (browser) |
+ *browser_handle = browser_tracker_->Add(browser); |
+ } |
+} |
+ |
// TODO(brettw) change this to accept GURLs when history supports it |
void TestingAutomationProvider::OnRedirectQueryComplete( |
HistoryService::Handle request_handle, |