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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void SetModifierKeyState(ui::EventFlags modifier, | 44 void SetModifierKeyState(ui::EventFlags modifier, |
45 StickyKeyState state); | 45 StickyKeyState state); |
46 | 46 |
47 // Get the current state of the sticky key modifier in the overlay. | 47 // Get the current state of the sticky key modifier in the overlay. |
48 StickyKeyState GetModifierKeyState(ui::EventFlags modifier); | 48 StickyKeyState GetModifierKeyState(ui::EventFlags modifier); |
49 | 49 |
50 // Returns true if the overlay is currently visible. If the overlay is | 50 // Returns true if the overlay is currently visible. If the overlay is |
51 // animating, the returned value is the target of the animation. | 51 // animating, the returned value is the target of the animation. |
52 bool is_visible() { return is_visible_; } | 52 bool is_visible() { return is_visible_; } |
53 | 53 |
54 // Returns the underlying views::Widget for testing purposes. The returned | |
55 // widget is owned by StickyKeysOverlay. | |
56 views::Widget* GetWidgetForTesting(); | |
57 | |
58 private: | 54 private: |
59 // Returns the current bounds of the overlay, which is based on visibility. | 55 // Returns the current bounds of the overlay, which is based on visibility. |
60 gfx::Rect CalculateOverlayBounds(); | 56 gfx::Rect CalculateOverlayBounds(); |
61 | 57 |
62 // gfx::LayerAnimationObserver overrides: | 58 // gfx::LayerAnimationObserver overrides: |
63 void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override; | 59 void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override; |
64 void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override; | 60 void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override; |
65 void OnLayerAnimationScheduled(ui::LayerAnimationSequence* sequence) override; | 61 void OnLayerAnimationScheduled(ui::LayerAnimationSequence* sequence) override; |
66 | 62 |
67 bool is_visible_; | 63 bool is_visible_; |
68 scoped_ptr<views::Widget> overlay_widget_; | 64 scoped_ptr<views::Widget> overlay_widget_; |
69 // The |overlay_view_| will be owned by |overlay_widget_|. | 65 // Ownership of |overlay_view_| is passed to the view heirarchy. |
70 StickyKeysOverlayView* overlay_view_; | 66 StickyKeysOverlayView* overlay_view_; |
71 gfx::Size widget_size_; | 67 gfx::Size widget_size_; |
72 }; | 68 }; |
73 | 69 |
74 } // namespace ash | 70 } // namespace ash |
75 | 71 |
76 #endif // ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ | 72 #endif // ASH_STICKY_KEYS_STICKY_KEYS_OVERLAY_H_ |
OLD | NEW |