| 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 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1049 return accessibility_object_.posInSet(); | 1049 return accessibility_object_.posInSet(); |
| 1050 } | 1050 } |
| 1051 | 1051 |
| 1052 int WebAXObjectProxy::SetSize() { | 1052 int WebAXObjectProxy::SetSize() { |
| 1053 accessibility_object_.updateLayoutAndCheckValidity(); | 1053 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1054 return accessibility_object_.setSize(); | 1054 return accessibility_object_.setSize(); |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 int WebAXObjectProxy::ClickPointX() { | 1057 int WebAXObjectProxy::ClickPointX() { |
| 1058 accessibility_object_.updateLayoutAndCheckValidity(); | 1058 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1059 return accessibility_object_.clickPoint().x; | 1059 blink::WebFloatRect bounds = BoundsForObject(accessibility_object_); |
| 1060 return bounds.x + bounds.width / 2; |
| 1060 } | 1061 } |
| 1061 | 1062 |
| 1062 int WebAXObjectProxy::ClickPointY() { | 1063 int WebAXObjectProxy::ClickPointY() { |
| 1063 accessibility_object_.updateLayoutAndCheckValidity(); | 1064 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1064 return accessibility_object_.clickPoint().y; | 1065 blink::WebFloatRect bounds = BoundsForObject(accessibility_object_); |
| 1066 return bounds.y + bounds.height / 2; |
| 1065 } | 1067 } |
| 1066 | 1068 |
| 1067 int32_t WebAXObjectProxy::RowCount() { | 1069 int32_t WebAXObjectProxy::RowCount() { |
| 1068 accessibility_object_.updateLayoutAndCheckValidity(); | 1070 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1069 return static_cast<int32_t>(accessibility_object_.rowCount()); | 1071 return static_cast<int32_t>(accessibility_object_.rowCount()); |
| 1070 } | 1072 } |
| 1071 | 1073 |
| 1072 int32_t WebAXObjectProxy::RowHeadersCount() { | 1074 int32_t WebAXObjectProxy::RowHeadersCount() { |
| 1073 accessibility_object_.updateLayoutAndCheckValidity(); | 1075 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1074 blink::WebVector<blink::WebAXObject> headers; | 1076 blink::WebVector<blink::WebAXObject> headers; |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1707 v8::Local<v8::Value> value_handle = gin::CreateHandle( | 1709 v8::Local<v8::Value> value_handle = gin::CreateHandle( |
| 1708 isolate, new WebAXObjectProxy(object, this)).ToV8(); | 1710 isolate, new WebAXObjectProxy(object, this)).ToV8(); |
| 1709 if (value_handle.IsEmpty()) | 1711 if (value_handle.IsEmpty()) |
| 1710 return v8::Local<v8::Object>(); | 1712 return v8::Local<v8::Object>(); |
| 1711 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); | 1713 v8::Local<v8::Object> handle = value_handle->ToObject(isolate); |
| 1712 elements_.Append(handle); | 1714 elements_.Append(handle); |
| 1713 return handle; | 1715 return handle; |
| 1714 } | 1716 } |
| 1715 | 1717 |
| 1716 } // namespace test_runner | 1718 } // namespace test_runner |
| OLD | NEW |