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

Unified Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 6507015: Implement the target locator commands for ChromeDriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use bool success instead of handle != 0 Created 9 years, 10 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/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..630d37395117954c91089edf165061061d6f8e8b 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,21 @@ void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle(
new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message);
}
+void TestingAutomationProvider::GetParentBrowserOfTab(int tab_handle,
+ int* browser_handle,
+ bool* success) {
+ *success = false;
+ 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);
+ *success = true;
+ }
+ }
+}
+
// TODO(brettw) change this to accept GURLs when history supports it
void TestingAutomationProvider::OnRedirectQueryComplete(
HistoryService::Handle request_handle,

Powered by Google App Engine
This is Rietveld 408576698