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

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

Issue 625443002: Reset accessibility if it gets out of sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed flakiness Created 6 years, 2 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 (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 #ifndef CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_COMPLETE_H_ 5 #ifndef CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_COMPLETE_H_
6 #define CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_COMPLETE_H_ 6 #define CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_COMPLETE_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 private: 63 private:
64 // Handlers for messages from the browser to the renderer. 64 // Handlers for messages from the browser to the renderer.
65 void OnDoDefaultAction(int acc_obj_id); 65 void OnDoDefaultAction(int acc_obj_id);
66 void OnEventsAck(); 66 void OnEventsAck();
67 void OnChangeScrollPosition(int acc_obj_id, int scroll_x, int scroll_y); 67 void OnChangeScrollPosition(int acc_obj_id, int scroll_x, int scroll_y);
68 void OnScrollToMakeVisible(int acc_obj_id, gfx::Rect subfocus); 68 void OnScrollToMakeVisible(int acc_obj_id, gfx::Rect subfocus);
69 void OnScrollToPoint(int acc_obj_id, gfx::Point point); 69 void OnScrollToPoint(int acc_obj_id, gfx::Point point);
70 void OnSetFocus(int acc_obj_id); 70 void OnSetFocus(int acc_obj_id);
71 void OnSetTextSelection(int acc_obj_id, int start_offset, int end_offset); 71 void OnSetTextSelection(int acc_obj_id, int start_offset, int end_offset);
72 void OnHitTest(gfx::Point point); 72 void OnHitTest(gfx::Point point);
73 void OnReset(int reset_token);
73 void OnFatalError(); 74 void OnFatalError();
74 75
75 // Events from Blink are collected until they are ready to be 76 // Events from Blink are collected until they are ready to be
76 // sent to the browser. 77 // sent to the browser.
77 std::vector<AccessibilityHostMsg_EventParams> pending_events_; 78 std::vector<AccessibilityHostMsg_EventParams> pending_events_;
78 79
79 // The adapter that exposes Blink's accessibility tree to AXTreeSerializer. 80 // The adapter that exposes Blink's accessibility tree to AXTreeSerializer.
80 BlinkAXTreeSource tree_source_; 81 BlinkAXTreeSource tree_source_;
81 82
82 // The serializer that sends accessibility messages to the browser process. 83 // The serializer that sends accessibility messages to the browser process.
83 ui::AXTreeSerializer<blink::WebAXObject> serializer_; 84 ui::AXTreeSerializer<blink::WebAXObject> serializer_;
84 85
85 // Current location of every object, so we can detect when it moves. 86 // Current location of every object, so we can detect when it moves.
86 base::hash_map<int, gfx::Rect> locations_; 87 base::hash_map<int, gfx::Rect> locations_;
87 88
88 // The most recently observed scroll offset of the root document element. 89 // The most recently observed scroll offset of the root document element.
89 // TODO(dmazzoni): remove once https://bugs.webkit.org/show_bug.cgi?id=73460 90 // TODO(dmazzoni): remove once https://bugs.webkit.org/show_bug.cgi?id=73460
90 // is fixed. 91 // is fixed.
91 gfx::Size last_scroll_offset_; 92 gfx::Size last_scroll_offset_;
92 93
93 // Set if we are waiting for an accessibility event ack. 94 // Set if we are waiting for an accessibility event ack.
94 bool ack_pending_; 95 bool ack_pending_;
95 96
97 // Nonzero if the browser requested we reset the accessibility state.
98 // We need to return this token in the next IPC.
99 int reset_token_;
100
96 // So we can queue up tasks to be executed later. 101 // So we can queue up tasks to be executed later.
97 base::WeakPtrFactory<RendererAccessibilityComplete> weak_factory_; 102 base::WeakPtrFactory<RendererAccessibilityComplete> weak_factory_;
98 103
99 DISALLOW_COPY_AND_ASSIGN(RendererAccessibilityComplete); 104 DISALLOW_COPY_AND_ASSIGN(RendererAccessibilityComplete);
100 }; 105 };
101 106
102 #endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_COMPLETE_H_ 107 #endif // CONTENT_RENDERER_ACCESSIBILITY_RENDERER_ACCESSIBILITY_COMPLETE_H_
103 108
104 } // namespace content 109 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698