Chromium Code Reviews| Index: ash/system/logout_button/logout_button_tray.h |
| diff --git a/ash/system/logout_button/logout_button_tray.h b/ash/system/logout_button/logout_button_tray.h |
| index 5683e5e2654c13f52e1d2e9efe0a9403e91b9cf2..b3c7ab87d2f79d33f52cb25bd01c788412087258 100644 |
| --- a/ash/system/logout_button/logout_button_tray.h |
| +++ b/ash/system/logout_button/logout_button_tray.h |
| @@ -5,11 +5,15 @@ |
| #ifndef ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_BUTTON_TRAY_H_ |
| #define ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_BUTTON_TRAY_H_ |
| +#include "ash/ash_export.h" |
| #include "ash/system/logout_button/logout_button_observer.h" |
| +#include "ash/system/logout_button/logout_confirmation_dialog_view.h" |
| #include "ash/system/tray/tray_background_view.h" |
| #include "ash/system/user/login_status.h" |
| #include "base/basictypes.h" |
| #include "base/compiler_specific.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/time/time.h" |
| #include "ui/views/controls/button/button.h" |
| namespace views { |
| @@ -23,13 +27,17 @@ class StatusAreaWidget; |
| // Adds a logout button to the launcher's status area if enabled by the |
| // kShowLogoutButtonInTray pref. |
| -class LogoutButtonTray : public TrayBackgroundView, |
| - public LogoutButtonObserver, |
| - public views::ButtonListener { |
| +class ASH_EXPORT LogoutButtonTray : public TrayBackgroundView, |
| + public LogoutButtonObserver, |
| + public views::ButtonListener { |
| public: |
| explicit LogoutButtonTray(StatusAreaWidget* status_area_widget); |
| virtual ~LogoutButtonTray(); |
| + bool IsConfirmationDialogShowing() const; |
| + void EnsureConfirmationDialogIsShowing(); |
| + void EnsureConfirmationDialogIsClosed(); |
|
stevenjb
2013/12/18 21:55:20
Do these need to be public?
binjin
2013/12/19 16:30:39
Done.
|
| + |
| // TrayBackgroundView: |
| virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; |
| virtual base::string16 GetAccessibleNameForTray() OVERRIDE; |
| @@ -39,6 +47,7 @@ class LogoutButtonTray : public TrayBackgroundView, |
| // LogoutButtonObserver: |
| virtual void OnShowLogoutButtonInTrayChanged(bool show) OVERRIDE; |
| + virtual void OnLogoutDialogDurationChanged(base::TimeDelta duration) OVERRIDE; |
| // views::ButtonListener: |
| virtual void ButtonPressed(views::Button* sender, |
| @@ -46,12 +55,23 @@ class LogoutButtonTray : public TrayBackgroundView, |
| void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
| + void ReleaseConfirmationDialog(); |
|
stevenjb
2013/12/18 21:55:20
Comment this. (UpdateAfterLoginStatusChange should
binjin
2013/12/19 16:30:39
Done. I didn't add comment for UpdateAfterLoginSta
|
| + |
| + void SetDelegateForTest( |
| + scoped_ptr<LogoutConfirmationDialogView::Delegate> delegate); |
| + |
| private: |
| + friend class LogoutConfirmationDialogTest; |
| + |
| void UpdateVisibility(); |
| views::LabelButton* button_; // Not owned. |
| user::LoginStatus login_status_; |
| bool show_logout_button_in_tray_; |
| + base::TimeDelta dialog_duration_; |
| + |
| + LogoutConfirmationDialogView* confirmation_dialog_; // Not owned. |
| + scoped_ptr<LogoutConfirmationDialogView::Delegate> confirmation_delegate_; |
| DISALLOW_COPY_AND_ASSIGN(LogoutButtonTray); |
| }; |