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

Unified Diff: chrome/test/automation/tab_proxy.cc

Issue 6507015: Implement the target locator commands for ChromeDriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... 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
« no previous file with comments | « chrome/test/automation/tab_proxy.h ('k') | chrome/test/webdriver/WEBDRIVER_TESTS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/automation/tab_proxy.cc
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index e04c039ba13fb10c8c826665b785068e11e3aa0c..1b413334fd8121979cc6c8141091287b2cc563e7 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -13,6 +13,7 @@
#include "chrome/common/automation_messages.h"
#include "chrome/common/json_value_serializer.h"
#include "chrome/test/automation/automation_proxy.h"
+#include "chrome/test/automation/browser_proxy.h"
#include "googleurl/src/gurl.h"
TabProxy::TabProxy(AutomationMessageSender* sender,
@@ -21,6 +22,29 @@ TabProxy::TabProxy(AutomationMessageSender* sender,
: AutomationResourceProxy(tracker, sender, handle) {
}
+scoped_refptr<BrowserProxy> TabProxy::GetParentBrowser() const {
+ if (!is_valid())
+ return NULL;
+
+ int browser_handle = 0;
+ bool success = false;
+ sender_->Send(new AutomationMsg_GetParentBrowserOfTab(
+ handle_, &browser_handle, &success));
+ if (!success)
+ return NULL;
+
+ BrowserProxy* browser = static_cast<BrowserProxy*>(
+ tracker_->GetResource(browser_handle));
+ if (!browser) {
+ browser = new BrowserProxy(sender_, tracker_, browser_handle);
+ browser->AddRef();
+ }
+
+ // Since there is no scoped_refptr::attach.
+ scoped_refptr<BrowserProxy> result;
+ result.swap(&browser);
+ return result;
+}
bool TabProxy::GetTabTitle(std::wstring* title) const {
if (!is_valid())
« no previous file with comments | « chrome/test/automation/tab_proxy.h ('k') | chrome/test/webdriver/WEBDRIVER_TESTS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698