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