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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 bool AccessibilityController::ShouldLogAccessibilityEvents() { | 161 bool AccessibilityController::ShouldLogAccessibilityEvents() { |
162 return log_accessibility_events_; | 162 return log_accessibility_events_; |
163 } | 163 } |
164 | 164 |
165 void AccessibilityController::NotificationReceived( | 165 void AccessibilityController::NotificationReceived( |
166 const blink::WebAXObject& target, const std::string& notification_name) { | 166 const blink::WebAXObject& target, const std::string& notification_name) { |
167 v8::Isolate* isolate = blink::mainThreadIsolate(); | 167 v8::Isolate* isolate = blink::mainThreadIsolate(); |
168 v8::HandleScope handle_scope(isolate); | 168 v8::HandleScope handle_scope(isolate); |
169 | 169 |
170 blink::WebFrame* frame = web_view_->mainFrame(); | 170 blink::WebFrame* frame = web_view_->mainFrame(); |
171 if (!frame) | 171 if (!frame || frame->isWebRemoteFrame()) |
172 return; | 172 return; |
173 | 173 |
174 v8::Handle<v8::Context> context = frame->mainWorldScriptContext(); | 174 v8::Handle<v8::Context> context = frame->mainWorldScriptContext(); |
175 if (context.IsEmpty()) | 175 if (context.IsEmpty()) |
176 return; | 176 return; |
177 | 177 |
178 v8::Context::Scope context_scope(context); | 178 v8::Context::Scope context_scope(context); |
179 | 179 |
180 // Call notification listeners on the element. | 180 // Call notification listeners on the element. |
181 v8::Handle<v8::Object> element_handle = elements_.GetOrCreate(target); | 181 v8::Handle<v8::Object> element_handle = elements_.GetOrCreate(target); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 v8::Handle<v8::Object> result = | 269 v8::Handle<v8::Object> result = |
270 FindAccessibleElementByIdRecursive(obj.childAt(i), id); | 270 FindAccessibleElementByIdRecursive(obj.childAt(i), id); |
271 if (*result) | 271 if (*result) |
272 return result; | 272 return result; |
273 } | 273 } |
274 | 274 |
275 return v8::Handle<v8::Object>(); | 275 return v8::Handle<v8::Object>(); |
276 } | 276 } |
277 | 277 |
278 } // namespace content | 278 } // namespace content |
OLD | NEW |