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

Side by Side Diff: content/renderer/accessibility/renderer_accessibility_complete.cc

Issue 684093003: Replace deprecated updateBackingStoreAndCheckValidity to updateLayoutAndCheckValidity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | content/shell/renderer/test_runner/accessibility_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer/accessibility/renderer_accessibility_complete.h" 5 #include "content/renderer/accessibility/renderer_accessibility_complete.h"
6 6
7 #include <queue> 7 #include <queue>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 200
201 // Loop over each event and generate an updated event message. 201 // Loop over each event and generate an updated event message.
202 for (size_t i = 0; i < src_events.size(); ++i) { 202 for (size_t i = 0; i < src_events.size(); ++i) {
203 AccessibilityHostMsg_EventParams& event = src_events[i]; 203 AccessibilityHostMsg_EventParams& event = src_events[i];
204 if (event.event_type == ui::AX_EVENT_LAYOUT_COMPLETE) 204 if (event.event_type == ui::AX_EVENT_LAYOUT_COMPLETE)
205 had_layout_complete_messages = true; 205 had_layout_complete_messages = true;
206 206
207 WebAXObject obj = document.accessibilityObjectFromID(event.id); 207 WebAXObject obj = document.accessibilityObjectFromID(event.id);
208 208
209 // Make sure the object still exists. 209 // Make sure the object still exists.
210 if (!obj.updateBackingStoreAndCheckValidity()) 210 if (!obj.updateLayoutAndCheckValidity())
211 continue; 211 continue;
212 212
213 // If it's ignored, find the first ancestor that's not ignored. 213 // If it's ignored, find the first ancestor that's not ignored.
214 while (!obj.isDetached() && obj.accessibilityIsIgnored()) 214 while (!obj.isDetached() && obj.accessibilityIsIgnored())
215 obj = obj.parentObject(); 215 obj = obj.parentObject();
216 216
217 // Make sure it's a descendant of our root node - exceptions include the 217 // Make sure it's a descendant of our root node - exceptions include the
218 // scroll area that's the parent of the main document (we ignore it), and 218 // scroll area that's the parent of the main document (we ignore it), and
219 // possibly nodes attached to a different document. 219 // possibly nodes attached to a different document.
220 if (!tree_source_.IsInTree(obj)) 220 if (!tree_source_.IsInTree(obj))
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 if (input_element && input_element->isTextField()) 386 if (input_element && input_element->isTextField())
387 input_element->setSelectionRange(start_offset, end_offset); 387 input_element->setSelectionRange(start_offset, end_offset);
388 } 388 }
389 } 389 }
390 390
391 void RendererAccessibilityComplete::OnHitTest(gfx::Point point) { 391 void RendererAccessibilityComplete::OnHitTest(gfx::Point point) {
392 const WebDocument& document = GetMainDocument(); 392 const WebDocument& document = GetMainDocument();
393 if (document.isNull()) 393 if (document.isNull())
394 return; 394 return;
395 WebAXObject root_obj = document.accessibilityObject(); 395 WebAXObject root_obj = document.accessibilityObject();
396 if (!root_obj.updateBackingStoreAndCheckValidity()) 396 if (!root_obj.updateLayoutAndCheckValidity())
397 return; 397 return;
398 398
399 WebAXObject obj = root_obj.hitTest(point); 399 WebAXObject obj = root_obj.hitTest(point);
400 if (!obj.isDetached()) 400 if (!obj.isDetached())
401 HandleAXEvent(obj, ui::AX_EVENT_HOVER); 401 HandleAXEvent(obj, ui::AX_EVENT_HOVER);
402 } 402 }
403 403
404 void RendererAccessibilityComplete::OnEventsAck() { 404 void RendererAccessibilityComplete::OnEventsAck() {
405 DCHECK(ack_pending_); 405 DCHECK(ack_pending_);
406 ack_pending_ = false; 406 ack_pending_ = false;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 const WebDocument& document = GetMainDocument(); 445 const WebDocument& document = GetMainDocument();
446 if (!document.isNull()) 446 if (!document.isNull())
447 HandleAXEvent(document.accessibilityObject(), ui::AX_EVENT_LAYOUT_COMPLETE); 447 HandleAXEvent(document.accessibilityObject(), ui::AX_EVENT_LAYOUT_COMPLETE);
448 } 448 }
449 449
450 void RendererAccessibilityComplete::OnFatalError() { 450 void RendererAccessibilityComplete::OnFatalError() {
451 CHECK(false) << "Invalid accessibility tree."; 451 CHECK(false) << "Invalid accessibility tree.";
452 } 452 }
453 453
454 } // namespace content 454 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/shell/renderer/test_runner/accessibility_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698