Chromium Code Reviews| Index: ash/common/system/chromeos/ime_menu/ime_menu_tray.h |
| diff --git a/ash/common/system/chromeos/ime_menu/ime_menu_tray.h b/ash/common/system/chromeos/ime_menu/ime_menu_tray.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..376b0579bbf91ea48770ec4f13cef860a4022514 |
| --- /dev/null |
| +++ b/ash/common/system/chromeos/ime_menu/ime_menu_tray.h |
| @@ -0,0 +1,57 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ |
| +#define ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ |
| + |
| +#include "ash/ash_export.h" |
| +#include "ash/common/system/ime/ime_observer.h" |
| +#include "ash/common/system/tray/system_tray_delegate.h" |
| +#include "ash/common/system/tray/tray_background_view.h" |
| +#include "base/macros.h" |
| + |
| +namespace views { |
| +class Label; |
| +} // namespace views |
| + |
| +namespace ash { |
| +class StatusAreaWidget; |
| +class WmWindow; |
| + |
| +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.
|
| + public: |
| + explicit ImeMenuTray(WmShelf* wm_shelf); |
| + ~ImeMenuTray() override; |
| + |
| + // TrayBackgroundView: |
| + void SetShelfAlignment(ShelfAlignment alignment) override; |
| + base::string16 GetAccessibleNameForTray() override; |
| + void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
| + void ClickedOutsideBubble() override; |
| + bool PerformAction(const ui::Event& event) override; |
| + |
| + // IMEObserver: |
| + void OnIMERefresh() override; |
| + void OnIMEMenuActivationChanged(bool is_activated) override; |
| + |
| + private: |
| + // To allow the test class to access |label_|. |
| + friend class ImeMenuTrayTest; |
| + |
| + // Updates the text of the label on the tray. |
| + void UpdateTrayLabel(); |
| + |
| + // Sets the border of the label to keep the tray width consistant. |
| + void SetLabelBorder(); |
| + |
| + views::Label* label_; |
| + IMEInfo current_ime_; |
| + 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
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(ImeMenuTray); |
| +}; |
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_COMMON_SYSTEM_CHROMEOS_IME_MENU_IME_MENU_TRAY_H_ |