| 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/element_commands.h" | 5 #include "chrome/test/chromedriver/element_commands.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 args, | 436 args, |
| 437 value); | 437 value); |
| 438 } | 438 } |
| 439 | 439 |
| 440 Status ExecuteGetElementLocationOnceScrolledIntoView( | 440 Status ExecuteGetElementLocationOnceScrolledIntoView( |
| 441 Session* session, | 441 Session* session, |
| 442 WebView* web_view, | 442 WebView* web_view, |
| 443 const std::string& element_id, | 443 const std::string& element_id, |
| 444 const base::DictionaryValue& params, | 444 const base::DictionaryValue& params, |
| 445 scoped_ptr<base::Value>* value) { | 445 scoped_ptr<base::Value>* value) { |
| 446 WebPoint offset(0, 0); |
| 446 WebPoint location; | 447 WebPoint location; |
| 447 Status status = ScrollElementIntoView( | 448 Status status = ScrollElementIntoView( |
| 448 session, web_view, element_id, nullptr, &location); | 449 session, web_view, element_id, &offset, &location); |
| 449 if (status.IsError()) | 450 if (status.IsError()) |
| 450 return status; | 451 return status; |
| 451 value->reset(CreateValueFrom(location)); | 452 value->reset(CreateValueFrom(location)); |
| 452 return Status(kOk); | 453 return Status(kOk); |
| 453 } | 454 } |
| 454 | 455 |
| 455 Status ExecuteGetElementSize( | 456 Status ExecuteGetElementSize( |
| 456 Session* session, | 457 Session* session, |
| 457 WebView* web_view, | 458 WebView* web_view, |
| 458 const std::string& element_id, | 459 const std::string& element_id, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 WebView* web_view, | 503 WebView* web_view, |
| 503 const std::string& element_id, | 504 const std::string& element_id, |
| 504 const base::DictionaryValue& params, | 505 const base::DictionaryValue& params, |
| 505 scoped_ptr<base::Value>* value) { | 506 scoped_ptr<base::Value>* value) { |
| 506 std::string other_element_id; | 507 std::string other_element_id; |
| 507 if (!params.GetString("other", &other_element_id)) | 508 if (!params.GetString("other", &other_element_id)) |
| 508 return Status(kUnknownError, "'other' must be a string"); | 509 return Status(kUnknownError, "'other' must be a string"); |
| 509 value->reset(new base::FundamentalValue(element_id == other_element_id)); | 510 value->reset(new base::FundamentalValue(element_id == other_element_id)); |
| 510 return Status(kOk); | 511 return Status(kOk); |
| 511 } | 512 } |
| OLD | NEW |