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