| 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 "content/shell/renderer/test_runner/web_ax_object_proxy.h" | 5 #include "content/shell/renderer/test_runner/web_ax_object_proxy.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "gin/handle.h" | 8 #include "gin/handle.h" |
| 9 #include "third_party/WebKit/public/platform/WebPoint.h" | 9 #include "third_party/WebKit/public/platform/WebPoint.h" |
| 10 #include "third_party/WebKit/public/platform/WebRect.h" | 10 #include "third_party/WebKit/public/platform/WebRect.h" |
| (...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 void WebAXObjectProxy::ScrollToGlobalPoint(int x, int y) { | 1157 void WebAXObjectProxy::ScrollToGlobalPoint(int x, int y) { |
| 1158 accessibility_object_.updateLayoutAndCheckValidity(); | 1158 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1159 accessibility_object_.scrollToGlobalPoint(blink::WebPoint(x, y)); | 1159 accessibility_object_.scrollToGlobalPoint(blink::WebPoint(x, y)); |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 int WebAXObjectProxy::WordStart(int character_index) { | 1162 int WebAXObjectProxy::WordStart(int character_index) { |
| 1163 accessibility_object_.updateLayoutAndCheckValidity(); | 1163 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1164 if (accessibility_object_.role() != blink::WebAXRoleStaticText) | 1164 if (accessibility_object_.role() != blink::WebAXRoleStaticText) |
| 1165 return -1; | 1165 return -1; |
| 1166 | 1166 |
| 1167 int word_start, word_end; | 1167 int word_start = 0, word_end = 0; |
| 1168 GetBoundariesForOneWord(accessibility_object_, character_index, | 1168 GetBoundariesForOneWord(accessibility_object_, character_index, |
| 1169 word_start, word_end); | 1169 word_start, word_end); |
| 1170 return word_start; | 1170 return word_start; |
| 1171 } | 1171 } |
| 1172 | 1172 |
| 1173 int WebAXObjectProxy::WordEnd(int character_index) { | 1173 int WebAXObjectProxy::WordEnd(int character_index) { |
| 1174 accessibility_object_.updateLayoutAndCheckValidity(); | 1174 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1175 if (accessibility_object_.role() != blink::WebAXRoleStaticText) | 1175 if (accessibility_object_.role() != blink::WebAXRoleStaticText) |
| 1176 return -1; | 1176 return -1; |
| 1177 | 1177 |
| 1178 int word_start, word_end; | 1178 int word_start = 0, word_end = 0; |
| 1179 GetBoundariesForOneWord(accessibility_object_, character_index, | 1179 GetBoundariesForOneWord(accessibility_object_, character_index, |
| 1180 word_start, word_end); | 1180 word_start, word_end); |
| 1181 return word_end; | 1181 return word_end; |
| 1182 } | 1182 } |
| 1183 | 1183 |
| 1184 std::string WebAXObjectProxy::Name() { | 1184 std::string WebAXObjectProxy::Name() { |
| 1185 accessibility_object_.updateLayoutAndCheckValidity(); | 1185 accessibility_object_.updateLayoutAndCheckValidity(); |
| 1186 blink::WebAXNameFrom nameFrom; | 1186 blink::WebAXNameFrom nameFrom; |
| 1187 blink::WebVector<blink::WebAXObject> nameObjects; | 1187 blink::WebVector<blink::WebAXObject> nameObjects; |
| 1188 return accessibility_object_.name(nameFrom, nameObjects).utf8(); | 1188 return accessibility_object_.name(nameFrom, nameObjects).utf8(); |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 v8::Handle<v8::Value> value_handle = gin::CreateHandle( | 1297 v8::Handle<v8::Value> value_handle = gin::CreateHandle( |
| 1298 isolate, new RootWebAXObjectProxy(object, this)).ToV8(); | 1298 isolate, new RootWebAXObjectProxy(object, this)).ToV8(); |
| 1299 if (value_handle.IsEmpty()) | 1299 if (value_handle.IsEmpty()) |
| 1300 return v8::Handle<v8::Object>(); | 1300 return v8::Handle<v8::Object>(); |
| 1301 v8::Handle<v8::Object> handle = value_handle->ToObject(isolate); | 1301 v8::Handle<v8::Object> handle = value_handle->ToObject(isolate); |
| 1302 elements_.Append(handle); | 1302 elements_.Append(handle); |
| 1303 return handle; | 1303 return handle; |
| 1304 } | 1304 } |
| 1305 | 1305 |
| 1306 } // namespace content | 1306 } // namespace content |
| OLD | NEW |