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

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

Issue 137373003: Show overlay displaying the state of all sticky keys when it is enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
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_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_
6 #define ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_
7
8 #include "ash/sticky_keys/sticky_keys_constants.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/events/event_constants.h"
11 #include "ui/gfx/animation/animation_delegate.h"
12
13 namespace gfx {
14 class Size;
15 class SlideAnimation;
16 }
17
18 namespace views {
19 class Widget;
20 }
21
22 namespace ash {
23
24 class StickyKeysOverlayView;
25
26 // Controls the overlay UI for sticky keys.
James Cook 2014/01/14 00:59:03 nit: This comment could mention what the UI looks
Tim Song 2014/01/14 03:01:10 Done.
27 class StickyKeysOverlay : public gfx::AnimationDelegate {
28 public:
29 StickyKeysOverlay();
30 virtual ~StickyKeysOverlay();
31
32 // Shows or hides the overlay.
33 void Show(bool visible);
34
35 // Updates the overlay with the current state of a sticky key modifier.
36 void SetModifierKeyState(StickyKeyModifier modifier,
37 StickyKeyState state);
38
39 private:
40 // Returns the size of the overlay widget, which is based on its content
41 // view.
42 gfx::Size GetWidgetSize();
43
44 // gfx::AnimationDelegate overrides:
45 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
46 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
47 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE;
48
49 bool is_showing_;
50 scoped_ptr<views::Widget> overlay_widget_;
51 scoped_ptr<gfx::Size> widget_size_;
James Cook 2014/01/14 00:59:03 Why not just a member gfx::Size?
Tim Song 2014/01/14 03:01:10 Done. We may need support for resizing the overlay
52 StickyKeysOverlayView* overlay_view_;
James Cook 2014/01/14 00:59:03 I presume this is not owned, might be nice to comm
Tim Song 2014/01/14 03:01:10 Done.
53 scoped_ptr<gfx::SlideAnimation> animation_;
54 };
55
56 } // ash
57
58 #endif //ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_
James Cook 2014/01/14 00:59:03 nit: space after //
Tim Song 2014/01/14 03:01:10 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698