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

Side by Side Diff: ash/accelerators/magnifier_key_scroller.h

Issue 164823005: Long press menu (shift+f6) to toggle spoken feedback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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/key_hold_detector.cc ('k') | ash/accelerators/magnifier_key_scroller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ASH_ACCELERATORS_MAGNIFIER_KEY_SCROLLER_H_
6 #define ASH_ACCELERATORS_MAGNIFIER_KEY_SCROLLER_H_
7
8 #include "ash/accelerators/key_hold_detector.h"
9 #include "ash/ash_export.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/events/event_handler.h"
12
13 namespace ui {
14 class KeyEvent;
15 }
16
17 namespace ash {
18
19 // A KeyHoldDetector delegate to control control magnified screen.
20 class ASH_EXPORT MagnifierKeyScroller : public KeyHoldDetector::Delegate {
21 public:
22 static bool IsEnabled();
23 static void SetEnabled(bool enabled);
24 static scoped_ptr<ui::EventHandler> CreateHandler();
25
26 // A scoped object to enable and disable the magnifier accelerator for test.
27 class ScopedEnablerForTest {
28 public:
29 ScopedEnablerForTest() {
30 SetEnabled(true);
31 }
32 ~ScopedEnablerForTest() {
33 SetEnabled(false);
34 }
35
36 private:
37 DISALLOW_COPY_AND_ASSIGN(ScopedEnablerForTest);
38 };
39
40 private:
41 // KeyHoldDetector overrides:
42 virtual bool ShouldProcessEvent(const ui::KeyEvent* event) const OVERRIDE;
43 virtual bool IsStartEvent(const ui::KeyEvent* event) const OVERRIDE;
44 virtual void OnKeyHold(const ui::KeyEvent* event) OVERRIDE;
45 virtual void OnKeyUnhold(const ui::KeyEvent* event) OVERRIDE;
46
47 MagnifierKeyScroller();
48 virtual ~MagnifierKeyScroller();
49
50 DISALLOW_COPY_AND_ASSIGN(MagnifierKeyScroller);
51 };
52
53 } // namespace ash
54
55 #endif // ASH_ACCELERATORS_MAGNIFIER_KEY_SCROLLER_H_
OLDNEW
« no previous file with comments | « ash/accelerators/key_hold_detector.cc ('k') | ash/accelerators/magnifier_key_scroller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698