Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ | 5 #ifndef ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ |
| 6 #define ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ | 6 #define ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/sticky_keys/sticky_keys_state.h" | 9 #include "ash/sticky_keys/sticky_keys_state.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 // a transparent window on the top left of the screen, showing the state of | 29 // a transparent window on the top left of the screen, showing the state of |
| 30 // each sticky key modifier. | 30 // each sticky key modifier. |
| 31 class ASH_EXPORT StickyKeysOverlay : public ui::LayerAnimationObserver { | 31 class ASH_EXPORT StickyKeysOverlay : public ui::LayerAnimationObserver { |
| 32 public: | 32 public: |
| 33 StickyKeysOverlay(); | 33 StickyKeysOverlay(); |
| 34 virtual ~StickyKeysOverlay(); | 34 virtual ~StickyKeysOverlay(); |
| 35 | 35 |
| 36 // Shows or hides the overlay. | 36 // Shows or hides the overlay. |
| 37 void Show(bool visible); | 37 void Show(bool visible); |
| 38 | 38 |
| 39 void SetModifiersVisible(bool mod3_visible, bool altgr_visible); | |
|
Tim Song
2014/03/05 19:22:27
It doesn't hurt to make this generic as it's possi
Zachary Kuznia
2014/03/05 21:12:30
Done.
| |
| 40 | |
| 39 // Updates the overlay with the current state of a sticky key modifier. | 41 // Updates the overlay with the current state of a sticky key modifier. |
| 40 void SetModifierKeyState(ui::EventFlags modifier, | 42 void SetModifierKeyState(ui::EventFlags modifier, |
| 41 StickyKeyState state); | 43 StickyKeyState state); |
| 42 | 44 |
| 43 // Get the current state of the sticky key modifier in the overlay. | 45 // Get the current state of the sticky key modifier in the overlay. |
| 44 StickyKeyState GetModifierKeyState(ui::EventFlags modifier); | 46 StickyKeyState GetModifierKeyState(ui::EventFlags modifier); |
| 45 | 47 |
| 46 // Returns true if the overlay is currently visible. If the overlay is | 48 // Returns true if the overlay is currently visible. If the overlay is |
| 47 // animating, the returned value is the target of the animation. | 49 // animating, the returned value is the target of the animation. |
| 48 bool is_visible() { return is_visible_; } | 50 bool is_visible() { return is_visible_; } |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 62 bool is_visible_; | 64 bool is_visible_; |
| 63 scoped_ptr<views::Widget> overlay_widget_; | 65 scoped_ptr<views::Widget> overlay_widget_; |
| 64 // Ownership of |overlay_view_| is passed to the view heirarchy. | 66 // Ownership of |overlay_view_| is passed to the view heirarchy. |
| 65 StickyKeysOverlayView* overlay_view_; | 67 StickyKeysOverlayView* overlay_view_; |
| 66 gfx::Size widget_size_; | 68 gfx::Size widget_size_; |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace ash | 71 } // namespace ash |
| 70 | 72 |
| 71 #endif // ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ | 73 #endif // ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ |
| OLD | NEW |