Chromium Code Reviews| 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_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ | |
| 6 #define ASH_COMMON_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" | |
|
James Cook
2016/06/30 21:15:47
not needed
Azure Wei
2016/07/01 03:48:04
This is for IMEInfo.
| |
| 11 #include "ash/common/system/tray/tray_background_view.h" | |
| 12 #include "ash/common/wm_window_observer.h" | |
| 13 #include "base/macros.h" | |
| 14 | |
| 15 namespace wm { | |
|
James Cook
2016/06/30 21:15:47
namespace wm not needed, WmWindow is in namespace
Azure Wei
2016/07/01 03:48:05
Done.
| |
| 16 class WmWindow; | |
| 17 } // namespace wm | |
| 18 | |
| 19 namespace views { | |
| 20 class Label; | |
| 21 } // namespace views | |
| 22 | |
| 23 namespace ash { | |
| 24 class StatusAreaWidget; | |
| 25 | |
| 26 class ASH_EXPORT ImeMenuTray : public TrayBackgroundView, | |
| 27 public IMEObserver, | |
| 28 public WmWindowObserver { | |
| 29 public: | |
| 30 explicit ImeMenuTray(WmShelf* wm_shelf); | |
| 31 ~ImeMenuTray() override; | |
| 32 | |
| 33 // Sets the IME menu window. | |
| 34 void SetImeWindow(WmWindow* window); | |
| 35 | |
| 36 // TrayBackgroundView: | |
| 37 void SetShelfAlignment(ShelfAlignment alignment) override; | |
| 38 base::string16 GetAccessibleNameForTray() override; | |
| 39 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | |
| 40 void ClickedOutsideBubble() override; | |
| 41 bool PerformAction(const ui::Event& event) override; | |
| 42 | |
| 43 // IMEObserver: | |
| 44 void OnIMERefresh() override; | |
| 45 void OnIMEMenuActivationChanged(bool is_activated) override; | |
| 46 | |
| 47 // WmWindowObserver: | |
| 48 void OnWindowVisibilityChanging(WmWindow* window, bool visible) override; | |
| 49 void OnWindowDestroying(WmWindow* window) override; | |
| 50 | |
| 51 private: | |
| 52 // To allow the test class to access GetLabelTextForTest() method. | |
| 53 friend class ImeMenuTrayTest; | |
| 54 | |
| 55 // Updates the text of the label on the tray. | |
| 56 void UpdateTrayLabel(); | |
| 57 | |
| 58 // Sets the border of the label to keep the tray width consistant. | |
| 59 void SetLabelBorder(); | |
| 60 | |
| 61 views::Label* label_; | |
| 62 WmWindow* window_; | |
| 63 ash::IMEInfo current_ime_; | |
|
James Cook
2016/06/30 21:15:47
ash:: not needed
Azure Wei
2016/07/01 03:48:05
Done.
| |
| 64 | |
| 65 DISALLOW_COPY_AND_ASSIGN(ImeMenuTray); | |
| 66 }; | |
| 67 | |
| 68 } // namespace ash | |
| 69 | |
| 70 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ | |
| OLD | NEW |