1 // Copyright 2012 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.
5 #ifndef ASH_SYSTEM_IME_TRAY_IME_CHROMEOS_H_
6 #define ASH_SYSTEM_IME_TRAY_IME_CHROMEOS_H_
8 #include "ash/system/chromeos/virtual_keyboard/virtual_keyboard_observer.h"
9 #include "ash/system/ime/ime_observer.h"
10 #include "ash/system/tray/system_tray_delegate.h"
11 #include "ash/system/tray/system_tray_item.h"
12 #include "ash/system/tray_accessibility.h"
23 class IMEDetailedView
;
24 class IMENotificationView
;
29 class ASH_EXPORT TrayIME
: public SystemTrayItem
,
31 public AccessibilityObserver
,
32 public VirtualKeyboardObserver
{
34 explicit TrayIME(SystemTray
* system_tray
);
37 // Overridden from VirtualKeyboardObserver.
38 void OnKeyboardSuppressionChanged(bool suppressed
) override
;
40 // Overridden from AccessibilityObserver:
41 void OnAccessibilityModeChanged(
42 ui::AccessibilityNotificationVisibility notify
) override
;
45 friend class TrayIMETest
;
47 // Repopulates the DefaultView and DetailedView.
49 // Updates the System Tray label.
50 void UpdateTrayLabel(const IMEInfo
& info
, size_t count
);
51 // Returns whether the virtual keyboard toggle should be shown in the
53 bool ShouldShowKeyboardToggle();
54 // Returns the appropriate label for the detailed view.
55 base::string16
GetDefaultViewLabel(bool show_ime_label
);
57 // Overridden from SystemTrayItem.
58 views::View
* CreateTrayView(user::LoginStatus status
) override
;
59 views::View
* CreateDefaultView(user::LoginStatus status
) override
;
60 views::View
* CreateDetailedView(user::LoginStatus status
) override
;
61 void DestroyTrayView() override
;
62 void DestroyDefaultView() override
;
63 void DestroyDetailedView() override
;
64 void UpdateAfterLoginStatusChange(user::LoginStatus status
) override
;
65 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment
) override
;
67 // Overridden from IMEObserver.
68 void OnIMERefresh() override
;
70 // Whether the default view should be shown.
71 bool ShouldDefaultViewBeVisible();
73 TrayItemView
* tray_label_
;
74 tray::IMEDefaultView
* default_
;
75 tray::IMEDetailedView
* detailed_
;
76 // Whether the virtual keyboard is suppressed.
77 bool keyboard_suppressed_
;
79 IMEInfoList ime_list_
;
81 IMEPropertyInfoList property_list_
;
83 DISALLOW_COPY_AND_ASSIGN(TrayIME
);
88 #endif // ASH_SYSTEM_IME_TRAY_IME_CHROMEOS_H_