Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: components/test_runner/web_ax_object_proxy.cc

Issue 2287433003: Get rid of remaining uses of AXObject::elementRect (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698