Index: chrome/test/chromedriver/session.cc |
diff --git a/chrome/test/chromedriver/session.cc b/chrome/test/chromedriver/session.cc |
index 9ba11e3e69cc31351c41ac6c2b2f7001e1d130a0..79092276fe0a55b12c015fe6a0152c6185c9e86c 100644 |
--- a/chrome/test/chromedriver/session.cc |
+++ b/chrome/test/chromedriver/session.cc |
@@ -45,19 +45,10 @@ Status Session::GetTargetWindow(WebView** web_view) { |
if (!chrome) |
return Status(kNoSuchWindow, "no chrome started in this session"); |
- std::list<WebView*> web_views; |
- Status status = chrome->GetWebViews(&web_views); |
+ Status status = chrome->GetWebViewById(window, web_view); |
if (status.IsError()) |
- return status; |
- |
- for (std::list<WebView*>::const_iterator it = web_views.begin(); |
- it != web_views.end(); ++it) { |
- if ((*it)->GetId() == window) { |
- *web_view = *it; |
- return Status(kOk); |
- } |
- } |
- return Status(kNoSuchWindow, "target window already closed"); |
+ status = Status(kNoSuchWindow, "target window already closed", status); |
+ return status; |
} |
void Session::SwitchToTopFrame() { |