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" | |
| 11 #include "ash/common/system/tray/tray_background_view.h" | |
| 12 #include "base/macros.h" | |
| 13 | |
| 14 namespace views { | |
| 15 class Label; | |
| 16 } // namespace views | |
| 17 | |
| 18 namespace ash { | |
| 19 class StatusAreaWidget; | |
| 20 class WmWindow; | |
| 21 | |
| 22 // The tray item for IME menu. | |
| 23 class ASH_EXPORT ImeMenuTray : public TrayBackgroundView, public IMEObserver { | |
| 24 public: | |
| 25 explicit ImeMenuTray(WmShelf* wm_shelf); | |
| 26 ~ImeMenuTray() override; | |
| 27 | |
| 28 // TrayBackgroundView: | |
| 29 void SetShelfAlignment(ShelfAlignment alignment) override; | |
| 30 base::string16 GetAccessibleNameForTray() override; | |
| 31 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | |
| 32 void ClickedOutsideBubble() override; | |
| 33 bool PerformAction(const ui::Event& event) override; | |
| 34 | |
| 35 // IMEObserver: | |
| 36 void OnIMERefresh() override; | |
| 37 void OnIMEMenuActivationChanged(bool is_activated) override; | |
| 38 | |
| 39 private: | |
| 40 // To allow the test class to access |label_|. | |
| 41 friend class ImeMenuTrayTest; | |
| 42 | |
| 43 // Updates the text of the label on the tray. | |
| 44 void UpdateTrayLabel(); | |
| 45 | |
| 46 // Highlights the button and show the IME menu tray bubble if |is_active_| is | |
|
James Cook
2016/07/14 15:47:35
nit: show -> shows, lowlight -> lowlights
Azure Wei
2016/07/15 01:58:12
Done.
| |
| 47 // true; otherwise, lowlight the button and hide the menu. | |
| 48 void SetTrayActivation(bool is_active_); | |
|
James Cook
2016/07/14 15:47:35
nit: "is_active" not "is_active_"
Azure Wei
2016/07/15 01:58:12
Done.
| |
| 49 | |
| 50 views::Label* label_; | |
| 51 IMEInfo current_ime_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(ImeMenuTray); | |
| 54 }; | |
| 55 | |
| 56 } // namespace ash | |
| 57 | |
| 58 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ | |
| OLD | NEW |