1 // Copyright (c) 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. 4 5 #ifndef ASH_SYSTEM_IME_TRAY_IME_H_ 6 #define ASH_SYSTEM_IME_TRAY_IME_H_ 7 8 #include "ash/system/ime/ime_observer.h" 9 #include "ash/system/tray/system_tray_item.h" 10 11 namespace views { 12 class Label; 13 } 14 15 namespace ash { 16 17 struct IMEInfo; 18 19 namespace internal { 20 21 namespace tray { 22 class IMEDefaultView; 23 class IMEDetailedView; 24 class IMENotificationView; 25 } 26 27 class TrayItemView; 28 29 class TrayIME : public SystemTrayItem, 30 public IMEObserver { 31 public: 32 explicit TrayIME(SystemTray* system_tray); 33 virtual ~TrayIME(); 34 35 private: 36 void UpdateTrayLabel(const IMEInfo& info, size_t count); 37 38 // Update the content of the existing IME notification, or create a new one if 39 // necessary. IME notification should be created only once in a session, i.e. 40 // if an IME notification is created and removed already, it doesn't create a 41 // new one. 42 void UpdateOrCreateNotification(); 43 44 // Overridden from SystemTrayItem. 45 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; 46 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; 47 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; 48 virtual void DestroyTrayView() OVERRIDE; 49 virtual void DestroyDefaultView() OVERRIDE; 50 virtual void DestroyDetailedView() OVERRIDE; 51 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; 52 virtual void UpdateAfterShelfAlignmentChange( 53 ShelfAlignment alignment) OVERRIDE; 54 55 // Overridden from IMEObserver. 56 virtual void OnIMERefresh(bool show_message) OVERRIDE; 57 58 TrayItemView* tray_label_; 59 tray::IMEDefaultView* default_; 60 tray::IMEDetailedView* detailed_; 61 62 bool message_shown_; 63 64 DISALLOW_COPY_AND_ASSIGN(TrayIME); 65 }; 66 67 } // namespace internal 68 } // namespace ash 69 70 #endif // ASH_SYSTEM_IME_TRAY_IME_H_ 71