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/window_commands.h" | 5 #include "chrome/test/chromedriver/window_commands.h" |
6 | 6 |
7 #include <list> | 7 #include <list> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 return status; | 340 return status; |
341 value->reset(new base::StringValue(url)); | 341 value->reset(new base::StringValue(url)); |
342 return Status(kOk); | 342 return Status(kOk); |
343 } | 343 } |
344 | 344 |
345 Status ExecuteGoBack( | 345 Status ExecuteGoBack( |
346 Session* session, | 346 Session* session, |
347 WebView* web_view, | 347 WebView* web_view, |
348 const base::DictionaryValue& params, | 348 const base::DictionaryValue& params, |
349 scoped_ptr<base::Value>* value) { | 349 scoped_ptr<base::Value>* value) { |
350 return web_view->EvaluateScript("", "window.history.back();", value); | 350 return web_view->EvaluateScript( |
| 351 std::string(), "window.history.back();", value); |
351 } | 352 } |
352 | 353 |
353 Status ExecuteGoForward( | 354 Status ExecuteGoForward( |
354 Session* session, | 355 Session* session, |
355 WebView* web_view, | 356 WebView* web_view, |
356 const base::DictionaryValue& params, | 357 const base::DictionaryValue& params, |
357 scoped_ptr<base::Value>* value) { | 358 scoped_ptr<base::Value>* value) { |
358 return web_view->EvaluateScript("", "window.history.forward();", value); | 359 return web_view->EvaluateScript( |
| 360 std::string(), "window.history.forward();", value); |
359 } | 361 } |
360 | 362 |
361 Status ExecuteRefresh( | 363 Status ExecuteRefresh( |
362 Session* session, | 364 Session* session, |
363 WebView* web_view, | 365 WebView* web_view, |
364 const base::DictionaryValue& params, | 366 const base::DictionaryValue& params, |
365 scoped_ptr<base::Value>* value) { | 367 scoped_ptr<base::Value>* value) { |
366 return web_view->Reload(); | 368 return web_view->Reload(); |
367 } | 369 } |
368 | 370 |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // |accuracy| is not part of the WebDriver spec yet, so if it is not given | 744 // |accuracy| is not part of the WebDriver spec yet, so if it is not given |
743 // default to 100 meters accuracy. | 745 // default to 100 meters accuracy. |
744 geoposition.accuracy = 100; | 746 geoposition.accuracy = 100; |
745 } | 747 } |
746 | 748 |
747 Status status = web_view->OverrideGeolocation(geoposition); | 749 Status status = web_view->OverrideGeolocation(geoposition); |
748 if (status.IsOk()) | 750 if (status.IsOk()) |
749 session->overridden_geoposition.reset(new Geoposition(geoposition)); | 751 session->overridden_geoposition.reset(new Geoposition(geoposition)); |
750 return status; | 752 return status; |
751 } | 753 } |
OLD | NEW |