| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/test_runner/web_ax_object_proxy.h" | 5 #include "components/test_runner/web_ax_object_proxy.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 return accessibility_object_.posInSet(); | 1042 return accessibility_object_.posInSet(); |
| 1043 } | 1043 } |
| 1044 | 1044 |
| 1045 int WebAXObjectProxy::SetSize() { | 1045 int WebAXObjectProxy::SetSize() { |
| 1046 accessibility_object_.updateLayoutAndCheckValidity(); | 1046 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1047 return accessibility_object_.setSize(); | 1047 return accessibility_object_.setSize(); |
| 1048 } | 1048 } |
| 1049 | 1049 |
| 1050 int WebAXObjectProxy::ClickPointX() { | 1050 int WebAXObjectProxy::ClickPointX() { |
| 1051 accessibility_object_.updateLayoutAndCheckValidity(); | 1051 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1052 return accessibility_object_.clickPoint().x; | 1052 blink::WebFloatRect bounds = BoundsForObject(accessibility_object_); |
| 1053 return bounds.x + bounds.width / 2; |
| 1053 } | 1054 } |
| 1054 | 1055 |
| 1055 int WebAXObjectProxy::ClickPointY() { | 1056 int WebAXObjectProxy::ClickPointY() { |
| 1056 accessibility_object_.updateLayoutAndCheckValidity(); | 1057 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1057 return accessibility_object_.clickPoint().y; | 1058 blink::WebFloatRect bounds = BoundsForObject(accessibility_object_); |
| 1059 return bounds.y + bounds.height / 2; |
| 1058 } | 1060 } |
| 1059 | 1061 |
| 1060 int32_t WebAXObjectProxy::RowCount() { | 1062 int32_t WebAXObjectProxy::RowCount() { |
| 1061 accessibility_object_.updateLayoutAndCheckValidity(); | 1063 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1062 return static_cast<int32_t>(accessibility_object_.rowCount()); | 1064 return static_cast<int32_t>(accessibility_object_.rowCount()); |
| 1063 } | 1065 } |
| 1064 | 1066 |
| 1065 int32_t WebAXObjectProxy::RowHeadersCount() { | 1067 int32_t WebAXObjectProxy::RowHeadersCount() { |
| 1066 accessibility_object_.updateLayoutAndCheckValidity(); | 1068 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1067 blink::WebVector<blink::WebAXObject> headers; | 1069 blink::WebVector<blink::WebAXObject> headers; |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1700 v8::Local<v8::Value> value_handle = gin::CreateHandle( | 1702 v8::Local<v8::Value> value_handle = gin::CreateHandle( |
| 1701 isolate, new WebAXObjectProxy(object, this)).ToV8(); | 1703 isolate, new WebAXObjectProxy(object, this)).ToV8(); |
| 1702 if (value_handle.IsEmpty()) | 1704 if (value_handle.IsEmpty()) |
| 1703 return v8::Local<v8::Object>(); | 1705 return v8::Local<v8::Object>(); |
| 1704 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); | 1706 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); |
| 1705 elements_.Append(handle); | 1707 elements_.Append(handle); |
| 1706 return handle; | 1708 return handle; |
| 1707 } | 1709 } |
| 1708 | 1710 |
| 1709 } // namespace test_runner | 1711 } // namespace test_runner |
| OLD | NEW |