| 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/accessibility_controller.h" | 5 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
| 6 | 6 |
| 7 #include "gin/handle.h" | 7 #include "gin/handle.h" |
| 8 #include "gin/object_template_builder.h" | 8 #include "gin/object_template_builder.h" |
| 9 #include "gin/wrappable.h" | 9 #include "gin/wrappable.h" |
| 10 #include "third_party/WebKit/public/web/WebElement.h" | 10 #include "third_party/WebKit/public/web/WebElement.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 184 |
| 185 WebAXObjectProxy* element; | 185 WebAXObjectProxy* element; |
| 186 bool result = gin::ConvertFromV8(isolate, element_handle, &element); | 186 bool result = gin::ConvertFromV8(isolate, element_handle, &element); |
| 187 DCHECK(result); | 187 DCHECK(result); |
| 188 element->NotificationReceived(frame, notification_name); | 188 element->NotificationReceived(frame, notification_name); |
| 189 | 189 |
| 190 if (notification_callback_.IsEmpty()) | 190 if (notification_callback_.IsEmpty()) |
| 191 return; | 191 return; |
| 192 | 192 |
| 193 // Call global notification listeners. | 193 // Call global notification listeners. |
| 194 #ifdef WEB_FRAME_USES_V8_LOCAL | |
| 195 v8::Local<v8::Value> argv[] = { | |
| 196 #else | |
| 197 v8::Handle<v8::Value> argv[] = { | 194 v8::Handle<v8::Value> argv[] = { |
| 198 #endif | |
| 199 element_handle, | 195 element_handle, |
| 200 v8::String::NewFromUtf8(isolate, notification_name.data(), | 196 v8::String::NewFromUtf8(isolate, notification_name.data(), |
| 201 v8::String::kNormalString, | 197 v8::String::kNormalString, |
| 202 notification_name.size()), | 198 notification_name.size()), |
| 203 }; | 199 }; |
| 204 frame->callFunctionEvenIfScriptDisabled( | 200 frame->callFunctionEvenIfScriptDisabled( |
| 205 v8::Local<v8::Function>::New(isolate, notification_callback_), | 201 v8::Local<v8::Function>::New(isolate, notification_callback_), |
| 206 context->Global(), | 202 context->Global(), |
| 207 arraysize(argv), | 203 arraysize(argv), |
| 208 argv); | 204 argv); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 v8::Handle<v8::Object> result = | 269 v8::Handle<v8::Object> result = |
| 274 FindAccessibleElementByIdRecursive(obj.childAt(i), id); | 270 FindAccessibleElementByIdRecursive(obj.childAt(i), id); |
| 275 if (*result) | 271 if (*result) |
| 276 return result; | 272 return result; |
| 277 } | 273 } |
| 278 | 274 |
| 279 return v8::Handle<v8::Object>(); | 275 return v8::Handle<v8::Object>(); |
| 280 } | 276 } |
| 281 | 277 |
| 282 } // namespace content | 278 } // namespace content |
| OLD | NEW |