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 class ASH_EXPORT ImeMenuTray : public TrayBackgroundView, public IMEObserver { | |
|
James Cook
2016/07/12 17:53:37
nit: class comment please.
Azure Wei
2016/07/14 02:57:02
Done.
| |
| 23 public: | |
| 24 explicit ImeMenuTray(WmShelf* wm_shelf); | |
| 25 ~ImeMenuTray() 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 // IMEObserver: | |
| 35 void OnIMERefresh() override; | |
| 36 void OnIMEMenuActivationChanged(bool is_activated) override; | |
| 37 | |
| 38 private: | |
| 39 // To allow the test class to access |label_|. | |
| 40 friend class ImeMenuTrayTest; | |
| 41 | |
| 42 // Updates the text of the label on the tray. | |
| 43 void UpdateTrayLabel(); | |
| 44 | |
| 45 // Sets the border of the label to keep the tray width consistant. | |
| 46 void SetLabelBorder(); | |
| 47 | |
| 48 views::Label* label_; | |
| 49 IMEInfo current_ime_; | |
| 50 bool is_active_; | |
|
James Cook
2016/07/12 17:53:37
nit: Document what is active. The button (highligh
Azure Wei
2016/07/14 02:57:02
Replaced this with function SetTrayActivation(bool
| |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(ImeMenuTray); | |
| 53 }; | |
| 54 | |
| 55 } // namespace ash | |
| 56 | |
| 57 #endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ | |
| OLD | NEW |