| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 std::list<std::string> web_view_ids; | 346 std::list<std::string> web_view_ids; |
| 347 Status status = session->chrome->GetWebViewIds(&web_view_ids, | 347 Status status = session->chrome->GetWebViewIds(&web_view_ids, |
| 348 session->w3c_compliant); | 348 session->w3c_compliant); |
| 349 if (status.IsError()) | 349 if (status.IsError()) |
| 350 return status; | 350 return status; |
| 351 std::unique_ptr<base::ListValue> window_ids(new base::ListValue()); | 351 std::unique_ptr<base::ListValue> window_ids(new base::ListValue()); |
| 352 for (std::list<std::string>::const_iterator it = web_view_ids.begin(); | 352 for (std::list<std::string>::const_iterator it = web_view_ids.begin(); |
| 353 it != web_view_ids.end(); ++it) { | 353 it != web_view_ids.end(); ++it) { |
| 354 window_ids->AppendString(WebViewIdToWindowHandle(*it)); | 354 window_ids->AppendString(WebViewIdToWindowHandle(*it)); |
| 355 } | 355 } |
| 356 value->reset(window_ids.release()); | 356 *value = std::move(window_ids); |
| 357 return Status(kOk); | 357 return Status(kOk); |
| 358 } | 358 } |
| 359 | 359 |
| 360 Status ExecuteSwitchToWindow(Session* session, | 360 Status ExecuteSwitchToWindow(Session* session, |
| 361 const base::DictionaryValue& params, | 361 const base::DictionaryValue& params, |
| 362 std::unique_ptr<base::Value>* value) { | 362 std::unique_ptr<base::Value>* value) { |
| 363 std::string name; | 363 std::string name; |
| 364 if (!params.GetString("name", &name)) | 364 if (!params.GetString("name", &name)) |
| 365 return Status(kUnknownError, "'name' must be a string"); | 365 return Status(kUnknownError, "'name' must be a string"); |
| 366 | 366 |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 std::unique_ptr<base::Value>* value) { | 896 std::unique_ptr<base::Value>* value) { |
| 897 WebView* web_view = nullptr; | 897 WebView* web_view = nullptr; |
| 898 Status status = session->GetTargetWindow(&web_view); | 898 Status status = session->GetTargetWindow(&web_view); |
| 899 if (status.IsError()) | 899 if (status.IsError()) |
| 900 return status; | 900 return status; |
| 901 status = web_view->DeleteScreenOrientation(); | 901 status = web_view->DeleteScreenOrientation(); |
| 902 if (status.IsError()) | 902 if (status.IsError()) |
| 903 return status; | 903 return status; |
| 904 return Status(kOk); | 904 return Status(kOk); |
| 905 } | 905 } |
| OLD | NEW |