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

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

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 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 <utility> 7 #include <utility>
8 8
9 #include "ash/accelerators/key_hold_detector.h" 9 #include "ash/accelerators/key_hold_detector.h"
10 #include "ash/common/accessibility_delegate.h" 10 #include "ash/common/accessibility_delegate.h"
(...skipping 24 matching lines...) Expand all
35 new KeyHoldDetector(std::move(delegate))); 35 new KeyHoldDetector(std::move(delegate)));
36 } 36 }
37 37
38 bool SpokenFeedbackToggler::ShouldProcessEvent( 38 bool SpokenFeedbackToggler::ShouldProcessEvent(
39 const ui::KeyEvent* event) const { 39 const ui::KeyEvent* event) const {
40 return IsEnabled() && event->key_code() == ui::VKEY_F6; 40 return IsEnabled() && event->key_code() == ui::VKEY_F6;
41 } 41 }
42 42
43 bool SpokenFeedbackToggler::IsStartEvent(const ui::KeyEvent* event) const { 43 bool SpokenFeedbackToggler::IsStartEvent(const ui::KeyEvent* event) const {
44 return event->type() == ui::ET_KEY_PRESSED && 44 return event->type() == ui::ET_KEY_PRESSED &&
45 event->flags() & ui::EF_SHIFT_DOWN; 45 event->flags() & ui::EF_SHIFT_DOWN;
46 } 46 }
47 47
48 bool SpokenFeedbackToggler::ShouldStopEventPropagation() const { 48 bool SpokenFeedbackToggler::ShouldStopEventPropagation() const {
49 // Let hotkey events pass through. See http://crbug.com/526729 49 // Let hotkey events pass through. See http://crbug.com/526729
50 return false; 50 return false;
51 } 51 }
52 52
53 void SpokenFeedbackToggler::OnKeyHold(const ui::KeyEvent* event) { 53 void SpokenFeedbackToggler::OnKeyHold(const ui::KeyEvent* event) {
54 if (!toggled_) { 54 if (!toggled_) {
55 toggled_ = true; 55 toggled_ = true;
56 Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback( 56 Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback(
57 A11Y_NOTIFICATION_SHOW); 57 A11Y_NOTIFICATION_SHOW);
58 } 58 }
59 } 59 }
60 60
61 void SpokenFeedbackToggler::OnKeyUnhold(const ui::KeyEvent* event) { 61 void SpokenFeedbackToggler::OnKeyUnhold(const ui::KeyEvent* event) {
62 toggled_ = false; 62 toggled_ = false;
63 } 63 }
64 64
65 SpokenFeedbackToggler::SpokenFeedbackToggler() : toggled_(false) {} 65 SpokenFeedbackToggler::SpokenFeedbackToggler() : toggled_(false) {}
66 66
67 SpokenFeedbackToggler::~SpokenFeedbackToggler() {} 67 SpokenFeedbackToggler::~SpokenFeedbackToggler() {}
68 68
69 } // namespace ash 69 } // namespace ash
OLDNEW
« no previous file with comments | « ash/accelerators/spoken_feedback_toggler.h ('k') | ash/ash_touch_exploration_manager_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698