OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ |
| 6 #define ASH_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ |
| 7 |
| 8 #include "ash/ash_export.h" |
| 9 #include "ash/common/system/ime/ime_observer.h" |
| 10 #include "ash/common/system/tray/system_tray_delegate.h" |
| 11 #include "ash/common/system/tray/tray_background_view.h" |
| 12 #include "ash/common/wm/window_state_observer.h" |
| 13 #include "base/macros.h" |
| 14 #include "ui/aura/window_observer.h" |
| 15 |
| 16 namespace aura { |
| 17 class Window; |
| 18 } // namespace arua |
| 19 |
| 20 namespace views { |
| 21 class Label; |
| 22 } // namespace views |
| 23 |
| 24 namespace ash { |
| 25 class StatusAreaWidget; |
| 26 |
| 27 class ASH_EXPORT ImeMenuTray : public TrayBackgroundView, |
| 28 public IMEObserver, |
| 29 public aura::WindowObserver { |
| 30 public: |
| 31 explicit ImeMenuTray(StatusAreaWidget* status_area_widget); |
| 32 ~ImeMenuTray() override; |
| 33 |
| 34 // Sets the IME menu window. |
| 35 void SetImeWindow(aura::Window* window); |
| 36 |
| 37 // TrayBackgroundView: |
| 38 void SetShelfAlignment(ShelfAlignment alignment) override; |
| 39 base::string16 GetAccessibleNameForTray() override; |
| 40 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
| 41 void ClickedOutsideBubble() override; |
| 42 bool PerformAction(const ui::Event& event) override; |
| 43 |
| 44 // IMEObserver: |
| 45 void OnIMERefresh() override; |
| 46 void OnIMEMenuActivationChanged(bool is_activated) override; |
| 47 |
| 48 // aura::WindowObserver: |
| 49 void OnWindowVisibilityChanging(aura::Window* window, bool visible) override; |
| 50 void OnWindowDestroying(aura::Window* window) override; |
| 51 |
| 52 private: |
| 53 // To allow the test class to access GetLabelTextForTest() method. |
| 54 friend class ImeMenuTrayTest; |
| 55 |
| 56 // Updates the text of the label on the tray. |
| 57 void UpdateTrayLabel(); |
| 58 |
| 59 // Sets the border of the label to keep the tray width consistant. |
| 60 void SetLabelBorder(); |
| 61 |
| 62 views::Label* label_; |
| 63 aura::Window* window_; |
| 64 ash::IMEInfo current_ime_; |
| 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(ImeMenuTray); |
| 67 }; |
| 68 |
| 69 } // namespace ash |
| 70 |
| 71 #endif // ASH_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ |
OLD | NEW |