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

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

Issue 267723008: Retires ui::TranslatedKeyEvent and replaces it with KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed AcceleratorControllerTest.MAYBE_ProcessOnce more. Created 6 years, 7 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 | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/wm/overlay_event_filter.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 #include "ash/sticky_keys/sticky_keys_controller.h" 5 #include "ash/sticky_keys/sticky_keys_controller.h"
6 6
7 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #undef RootWindow 10 #undef RootWindow
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 bool StickyKeysController::HandleScrollEvent(ui::ScrollEvent* event) { 174 bool StickyKeysController::HandleScrollEvent(ui::ScrollEvent* event) {
175 return shift_sticky_key_->HandleScrollEvent(event) || 175 return shift_sticky_key_->HandleScrollEvent(event) ||
176 alt_sticky_key_->HandleScrollEvent(event) || 176 alt_sticky_key_->HandleScrollEvent(event) ||
177 altgr_sticky_key_->HandleScrollEvent(event) || 177 altgr_sticky_key_->HandleScrollEvent(event) ||
178 ctrl_sticky_key_->HandleScrollEvent(event) || 178 ctrl_sticky_key_->HandleScrollEvent(event) ||
179 mod3_sticky_key_->HandleScrollEvent(event); 179 mod3_sticky_key_->HandleScrollEvent(event);
180 } 180 }
181 181
182 void StickyKeysController::OnKeyEvent(ui::KeyEvent* event) { 182 void StickyKeysController::OnKeyEvent(ui::KeyEvent* event) {
183 // Do not consume a translated key event which is generated by an IME. 183 // Do not consume a translated key event which is generated by an IME.
184 if (event->type() == ui::ET_TRANSLATED_KEY_PRESS || 184 if (event->IsTranslated())
185 event->type() == ui::ET_TRANSLATED_KEY_RELEASE) {
186 return; 185 return;
187 }
188 186
189 if (enabled_) { 187 if (enabled_) {
190 if (HandleKeyEvent(event)) 188 if (HandleKeyEvent(event))
191 event->StopPropagation(); 189 event->StopPropagation();
192 UpdateOverlay(); 190 UpdateOverlay();
193 } 191 }
194 } 192 }
195 193
196 void StickyKeysController::OnMouseEvent(ui::MouseEvent* event) { 194 void StickyKeysController::OnMouseEvent(ui::MouseEvent* event) {
197 if (enabled_) { 195 if (enabled_) {
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 &xievent->mods.effective)); 542 &xievent->mods.effective));
545 } 543 }
546 } 544 }
547 #elif defined(USE_OZONE) 545 #elif defined(USE_OZONE)
548 NOTIMPLEMENTED() << "Modifier key is not handled"; 546 NOTIMPLEMENTED() << "Modifier key is not handled";
549 #endif 547 #endif
550 event->set_flags(event->flags() | modifier_flag_); 548 event->set_flags(event->flags() | modifier_flag_);
551 } 549 }
552 550
553 } // namespace ash 551 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/wm/overlay_event_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698