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

Side by Side Diff: ash/sticky_keys/sticky_keys_controller.h

Issue 227113009: Fix sticky keys crash when handling synthetic events without a native event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: got reverted for a clang compile warning Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ash/sticky_keys/sticky_keys_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_ 5 #ifndef ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_
6 #define ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_ 6 #define ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/sticky_keys/sticky_keys_state.h" 9 #include "ash/sticky_keys/sticky_keys_state.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // 140 //
141 // Here, (*) means key event will be consumed by StickyKeys, and (#) means event 141 // Here, (*) means key event will be consumed by StickyKeys, and (#) means event
142 // is modified. 142 // is modified.
143 class ASH_EXPORT StickyKeysHandler { 143 class ASH_EXPORT StickyKeysHandler {
144 public: 144 public:
145 class StickyKeysHandlerDelegate { 145 class StickyKeysHandlerDelegate {
146 public: 146 public:
147 StickyKeysHandlerDelegate(); 147 StickyKeysHandlerDelegate();
148 virtual ~StickyKeysHandlerDelegate(); 148 virtual ~StickyKeysHandlerDelegate();
149 149
150 // Dispatches keyboard event synchronously. 150 // Dispatches keyboard event synchronously. |event| is an event that has
151 // been previously dispatched.
151 virtual void DispatchKeyEvent(ui::KeyEvent* event, 152 virtual void DispatchKeyEvent(ui::KeyEvent* event,
152 aura::Window* target) = 0; 153 aura::Window* target) = 0;
153 154
154 // Dispatches mouse event synchronously. 155 // Dispatches mouse event synchronously. |event| is an event that has
156 // been previously dispatched.
155 virtual void DispatchMouseEvent(ui::MouseEvent* event, 157 virtual void DispatchMouseEvent(ui::MouseEvent* event,
156 aura::Window* target) = 0; 158 aura::Window* target) = 0;
157 159
158 // Dispatches scroll event synchronously. 160 // Dispatches scroll event synchronously. |event| is an event that has
161 // been previously dispatched.
159 virtual void DispatchScrollEvent(ui::ScrollEvent* event, 162 virtual void DispatchScrollEvent(ui::ScrollEvent* event,
160 aura::Window* target) = 0; 163 aura::Window* target) = 0;
161 }; 164 };
162 165
163 // This class takes an ownership of |delegate|. 166 // This class takes an ownership of |delegate|.
164 StickyKeysHandler(ui::EventFlags modifier_flag, 167 StickyKeysHandler(ui::EventFlags modifier_flag,
165 StickyKeysHandlerDelegate* delegate); 168 StickyKeysHandlerDelegate* delegate);
166 ~StickyKeysHandler(); 169 ~StickyKeysHandler();
167 170
168 // Handles key event. Returns true if key is consumed. 171 // Handles key event. Returns true if key is consumed.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 scoped_ptr<ui::KeyEvent> modifier_up_event_; 241 scoped_ptr<ui::KeyEvent> modifier_up_event_;
239 242
240 scoped_ptr<StickyKeysHandlerDelegate> delegate_; 243 scoped_ptr<StickyKeysHandlerDelegate> delegate_;
241 244
242 DISALLOW_COPY_AND_ASSIGN(StickyKeysHandler); 245 DISALLOW_COPY_AND_ASSIGN(StickyKeysHandler);
243 }; 246 };
244 247
245 } // namespace ash 248 } // namespace ash
246 249
247 #endif // ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_ 250 #endif // ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | ash/sticky_keys/sticky_keys_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698