| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/test/chromedriver/session_commands.h" | 5 #include "chrome/test/chromedriver/session_commands.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 for (std::list<std::string>::const_iterator it = web_view_ids.begin(); | 194 for (std::list<std::string>::const_iterator it = web_view_ids.begin(); |
| 195 it != web_view_ids.end(); ++it) { | 195 it != web_view_ids.end(); ++it) { |
| 196 scoped_ptr<base::Value> result; | 196 scoped_ptr<base::Value> result; |
| 197 WebView* web_view; | 197 WebView* web_view; |
| 198 status = session->chrome->GetWebViewById(*it, &web_view); | 198 status = session->chrome->GetWebViewById(*it, &web_view); |
| 199 if (status.IsError()) | 199 if (status.IsError()) |
| 200 return status; | 200 return status; |
| 201 status = web_view->ConnectIfNecessary(); | 201 status = web_view->ConnectIfNecessary(); |
| 202 if (status.IsError()) | 202 if (status.IsError()) |
| 203 return status; | 203 return status; |
| 204 status = web_view->CallFunction("", kGetWindowNameScript, args, &result); | 204 status = web_view->CallFunction( |
| 205 std::string(), kGetWindowNameScript, args, &result); |
| 205 if (status.IsError()) | 206 if (status.IsError()) |
| 206 return status; | 207 return status; |
| 207 std::string window_name; | 208 std::string window_name; |
| 208 if (!result->GetAsString(&window_name)) | 209 if (!result->GetAsString(&window_name)) |
| 209 return Status(kUnknownError, "failed to get window name"); | 210 return Status(kUnknownError, "failed to get window name"); |
| 210 if (window_name == name) { | 211 if (window_name == name) { |
| 211 web_view_id = *it; | 212 web_view_id = *it; |
| 212 found = true; | 213 found = true; |
| 213 break; | 214 break; |
| 214 } | 215 } |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 Session* session, | 465 Session* session, |
| 465 const base::DictionaryValue& params, | 466 const base::DictionaryValue& params, |
| 466 scoped_ptr<base::Value>* value) { | 467 scoped_ptr<base::Value>* value) { |
| 467 AutomationExtension* extension = NULL; | 468 AutomationExtension* extension = NULL; |
| 468 Status status = session->chrome->GetAutomationExtension(&extension); | 469 Status status = session->chrome->GetAutomationExtension(&extension); |
| 469 if (status.IsError()) | 470 if (status.IsError()) |
| 470 return status; | 471 return status; |
| 471 | 472 |
| 472 return extension->MaximizeWindow(); | 473 return extension->MaximizeWindow(); |
| 473 } | 474 } |
| OLD | NEW |