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

Side by Side Diff: ash/accelerators/spoken_feedback_toggler.cc

Issue 682943002: Make chrome/browser/chromeos/accessibility compile on Athena with use_ash=0 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_do_not_use_ash41_scroll_end_effect
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 | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/accessibility_delegate.h » ('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 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 "ash/accelerators/spoken_feedback_toggler.h" 5 #include "ash/accelerators/spoken_feedback_toggler.h"
6 6
7 #include "ash/accelerators/key_hold_detector.h" 7 #include "ash/accelerators/key_hold_detector.h"
8 #include "ash/accessibility_delegate.h" 8 #include "ash/accessibility_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 10
(...skipping 25 matching lines...) Expand all
36 36
37 bool SpokenFeedbackToggler::IsStartEvent(const ui::KeyEvent* event) const { 37 bool SpokenFeedbackToggler::IsStartEvent(const ui::KeyEvent* event) const {
38 return event->type() == ui::ET_KEY_PRESSED && 38 return event->type() == ui::ET_KEY_PRESSED &&
39 event->flags() & ui::EF_SHIFT_DOWN; 39 event->flags() & ui::EF_SHIFT_DOWN;
40 } 40 }
41 41
42 void SpokenFeedbackToggler::OnKeyHold(const ui::KeyEvent* event) { 42 void SpokenFeedbackToggler::OnKeyHold(const ui::KeyEvent* event) {
43 if (!toggled_) { 43 if (!toggled_) {
44 toggled_ = true; 44 toggled_ = true;
45 Shell::GetInstance()->accessibility_delegate()-> 45 Shell::GetInstance()->accessibility_delegate()->
46 ToggleSpokenFeedback(A11Y_NOTIFICATION_SHOW); 46 ToggleSpokenFeedback(ui::A11Y_NOTIFICATION_SHOW);
47 } 47 }
48 } 48 }
49 49
50 void SpokenFeedbackToggler::OnKeyUnhold(const ui::KeyEvent* event) { 50 void SpokenFeedbackToggler::OnKeyUnhold(const ui::KeyEvent* event) {
51 toggled_ = false; 51 toggled_ = false;
52 } 52 }
53 53
54 SpokenFeedbackToggler::SpokenFeedbackToggler() : toggled_(false) {} 54 SpokenFeedbackToggler::SpokenFeedbackToggler() : toggled_(false) {}
55 55
56 SpokenFeedbackToggler::~SpokenFeedbackToggler() {} 56 SpokenFeedbackToggler::~SpokenFeedbackToggler() {}
57 57
58 } // namespace ash 58 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_controller_unittest.cc ('k') | ash/accessibility_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698