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_SYSTEM_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ | 5 #ifndef ASH_SYSTEM_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ |
6 #define ASH_SYSTEM_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ | 6 #define ASH_SYSTEM_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ |
7 | 7 |
8 #include "ash/keyboard/keyboard_ui_observer.h" | 8 #include "ash/keyboard/keyboard_ui_observer.h" |
9 #include "ash/system/tray/tray_background_view.h" | 9 #include "ash/system/tray/tray_background_view.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "ui/keyboard/keyboard_controller_observer.h" | 11 #include "ui/keyboard/keyboard_controller_observer.h" |
12 | 12 |
13 namespace views { | 13 namespace views { |
14 class ImageView; | 14 class ImageView; |
15 } | 15 } |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 | 18 |
19 // TODO(sky): make this visible on non-chromeos platforms. | 19 // TODO(sky): make this visible on non-chromeos platforms. |
20 class VirtualKeyboardTray : public TrayBackgroundView, | 20 class VirtualKeyboardTray : public TrayBackgroundView, |
21 public KeyboardUIObserver, | 21 public KeyboardUIObserver, |
22 public keyboard::KeyboardControllerObserver { | 22 public keyboard::KeyboardControllerObserver { |
23 public: | 23 public: |
24 explicit VirtualKeyboardTray(WmShelf* wm_shelf); | 24 explicit VirtualKeyboardTray(Shelf* shelf); |
25 ~VirtualKeyboardTray() override; | 25 ~VirtualKeyboardTray() override; |
26 | 26 |
27 // TrayBackgroundView: | 27 // TrayBackgroundView: |
28 base::string16 GetAccessibleNameForTray() override; | 28 base::string16 GetAccessibleNameForTray() override; |
29 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 29 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
30 void ClickedOutsideBubble() override; | 30 void ClickedOutsideBubble() override; |
31 bool PerformAction(const ui::Event& event) override; | 31 bool PerformAction(const ui::Event& event) override; |
32 | 32 |
33 // KeyboardUIObserver: | 33 // KeyboardUIObserver: |
34 void OnKeyboardEnabledStateChanged(bool new_enabled) override; | 34 void OnKeyboardEnabledStateChanged(bool new_enabled) override; |
35 | 35 |
36 // keyboard::KeyboardControllerObserver: | 36 // keyboard::KeyboardControllerObserver: |
37 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; | 37 void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) override; |
38 void OnKeyboardClosed() override; | 38 void OnKeyboardClosed() override; |
39 | 39 |
40 private: | 40 private: |
41 void ObserveKeyboardController(); | 41 void ObserveKeyboardController(); |
42 void UnobserveKeyboardController(); | 42 void UnobserveKeyboardController(); |
43 | 43 |
44 // Weak pointer, will be parented by TrayContainer for its lifetime. | 44 // Weak pointer, will be parented by TrayContainer for its lifetime. |
45 views::ImageView* icon_; | 45 views::ImageView* icon_; |
46 | 46 |
47 WmShelf* wm_shelf_; | 47 Shelf* shelf_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardTray); | 49 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardTray); |
50 }; | 50 }; |
51 | 51 |
52 } // namespace ash | 52 } // namespace ash |
53 | 53 |
54 #endif // ASH_SYSTEM_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ | 54 #endif // ASH_SYSTEM_VIRTUAL_KEYBOARD_VIRTUAL_KEYBOARD_TRAY_H_ |
OLD | NEW |