Home | History | Annotate | Download | only in logout_button
      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_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_H_
      6 #define ASH_SYSTEM_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_H_
      7 
      8 #include "ash/system/logout_button/logout_button_observer.h"
      9 #include "ash/system/tray/system_tray_item.h"
     10 #include "base/basictypes.h"
     11 #include "base/compiler_specific.h"
     12 
     13 namespace ash {
     14 namespace internal {
     15 
     16 namespace tray {
     17 class LogoutButton;
     18 }
     19 
     20 // Adds a logout button to the system tray if enabled by the
     21 // kShowLogoutButtonInTray pref.
     22 class TrayLogoutButton : public SystemTrayItem, public LogoutButtonObserver {
     23  public:
     24   explicit TrayLogoutButton(SystemTray* system_tray);
     25   virtual ~TrayLogoutButton();
     26 
     27   // Overridden from SystemTrayItem.
     28   virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
     29   virtual void DestroyTrayView() OVERRIDE;
     30   virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
     31 
     32   // Overridden from LogoutButtonObserver.
     33   virtual void OnShowLogoutButtonInTrayChanged(bool show) OVERRIDE;
     34 
     35  private:
     36   tray::LogoutButton* logout_button_;
     37 
     38   DISALLOW_COPY_AND_ASSIGN(TrayLogoutButton);
     39 };
     40 
     41 }  // namespace internal
     42 }  // namespace ash
     43 
     44 #endif  // ASH_SYSTEM_LOGOUT_BUTTON_TRAY_LOGOUT_BUTTON_H_
     45