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 #include "ash/sticky_keys/sticky_keys_overlay.h" | 5 #include "ash/sticky_keys/sticky_keys_overlay.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/sticky_keys/sticky_keys_controller.h" | 9 #include "ash/sticky_keys/sticky_keys_controller.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 const int kSlideAnimationDurationMs = 100; | 40 const int kSlideAnimationDurationMs = 100; |
41 | 41 |
42 } | 42 } |
43 | 43 |
44 /////////////////////////////////////////////////////////////////////////////// | 44 /////////////////////////////////////////////////////////////////////////////// |
45 // StickyKeyOverlayLabel | 45 // StickyKeyOverlayLabel |
46 class StickyKeyOverlayLabel : public views::Label { | 46 class StickyKeyOverlayLabel : public views::Label { |
47 public: | 47 public: |
48 explicit StickyKeyOverlayLabel(const std::string& key_name); | 48 explicit StickyKeyOverlayLabel(const std::string& key_name); |
49 | 49 |
50 virtual ~StickyKeyOverlayLabel(); | 50 ~StickyKeyOverlayLabel() override; |
51 | 51 |
52 StickyKeyState state() const { return state_; } | 52 StickyKeyState state() const { return state_; } |
53 | 53 |
54 void SetKeyState(StickyKeyState state); | 54 void SetKeyState(StickyKeyState state); |
55 | 55 |
56 private: | 56 private: |
57 StickyKeyState state_; | 57 StickyKeyState state_; |
58 | 58 |
59 DISALLOW_COPY_AND_ASSIGN(StickyKeyOverlayLabel); | 59 DISALLOW_COPY_AND_ASSIGN(StickyKeyOverlayLabel); |
60 }; | 60 }; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 SetDisabledColor(label_color); | 98 SetDisabledColor(label_color); |
99 SetFontList(font_list().DeriveWithStyle(style)); | 99 SetFontList(font_list().DeriveWithStyle(style)); |
100 } | 100 } |
101 | 101 |
102 /////////////////////////////////////////////////////////////////////////////// | 102 /////////////////////////////////////////////////////////////////////////////// |
103 // StickyKeysOverlayView | 103 // StickyKeysOverlayView |
104 class StickyKeysOverlayView : public views::WidgetDelegateView { | 104 class StickyKeysOverlayView : public views::WidgetDelegateView { |
105 public: | 105 public: |
106 StickyKeysOverlayView(); | 106 StickyKeysOverlayView(); |
107 | 107 |
108 virtual ~StickyKeysOverlayView(); | 108 ~StickyKeysOverlayView() override; |
109 | 109 |
110 // views::WidgetDelegateView overrides: | 110 // views::WidgetDelegateView overrides: |
111 virtual void OnPaint(gfx::Canvas* canvas) override; | 111 void OnPaint(gfx::Canvas* canvas) override; |
112 | 112 |
113 void SetKeyState(ui::EventFlags modifier, StickyKeyState state); | 113 void SetKeyState(ui::EventFlags modifier, StickyKeyState state); |
114 | 114 |
115 StickyKeyState GetKeyState(ui::EventFlags modifier); | 115 StickyKeyState GetKeyState(ui::EventFlags modifier); |
116 | 116 |
117 void SetModifierVisible(ui::EventFlags modifier, bool visible); | 117 void SetModifierVisible(ui::EventFlags modifier, bool visible); |
118 bool GetModifierVisible(ui::EventFlags modifier); | 118 bool GetModifierVisible(ui::EventFlags modifier); |
119 | 119 |
120 private: | 120 private: |
121 void AddKeyLabel(ui::EventFlags modifier, const std::string& key_label); | 121 void AddKeyLabel(ui::EventFlags modifier, const std::string& key_label); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 ui::LayerAnimator* animator = overlay_widget_->GetLayer()->GetAnimator(); | 298 ui::LayerAnimator* animator = overlay_widget_->GetLayer()->GetAnimator(); |
299 if (animator) | 299 if (animator) |
300 animator->RemoveObserver(this); | 300 animator->RemoveObserver(this); |
301 } | 301 } |
302 | 302 |
303 void StickyKeysOverlay::OnLayerAnimationScheduled( | 303 void StickyKeysOverlay::OnLayerAnimationScheduled( |
304 ui::LayerAnimationSequence* sequence) { | 304 ui::LayerAnimationSequence* sequence) { |
305 } | 305 } |
306 | 306 |
307 } // namespace ash | 307 } // namespace ash |
OLD | NEW |