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..1fc713f1c142c7db5e11d8a6a746f2a63defcca4 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/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/memory/weak_ptr.h" |
| +#include "base/time/time.h" |
| #include "ui/views/controls/button/button.h" |
| namespace views { |
| @@ -19,17 +23,23 @@ class LabelButton; |
| namespace ash { |
| namespace internal { |
| +class LogoutConfirmationDialogView; |
| +class LogoutConfirmationSettingsProvider; |
| class StatusAreaWidget; |
| // Adds a logout button to the launcher's status area if enabled by the |
| // kShowLogoutButtonInTray pref. |
| -class LogoutButtonTray : public TrayBackgroundView, |
| +class ASH_EXPORT LogoutButtonTray : public TrayBackgroundView, |
| public LogoutButtonObserver, |
| public views::ButtonListener { |
| public: |
| explicit LogoutButtonTray(StatusAreaWidget* status_area_widget); |
| virtual ~LogoutButtonTray(); |
| + void EnsureConfirmationDialogIsShowing(); |
| + void EnsureConfirmationDialogIsClosed(); |
| + bool IsConfirmationDialogShowing(); |
| + |
| // TrayBackgroundView: |
| virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; |
| virtual base::string16 GetAccessibleNameForTray() OVERRIDE; |
| @@ -39,6 +49,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 +57,22 @@ class LogoutButtonTray : public TrayBackgroundView, |
| void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
| + void DeleteConfirmationDialog(); |
| + |
| + void OnUserLogoutEvent(); |
|
bartfab (slow)
2013/12/03 19:46:04
This method name is rather cryptic. Also, the meth
binjin
2013/12/04 10:47:03
The reason I didn't call ButtonPressed() directly
bartfab (slow)
2013/12/04 12:51:56
You can make the test a friend of LogoutButtonTray
binjin
2013/12/05 10:08:05
Done.
|
| + |
| + LogoutConfirmationDialogView* GetConfirmationDialog(); |
|
bartfab (slow)
2013/12/03 19:46:04
Nit: This is used in tests only. You could rename
binjin
2013/12/04 10:47:03
Done.
|
| + |
| private: |
| void UpdateVisibility(); |
| views::LabelButton* button_; // Not owned. |
| user::LoginStatus login_status_; |
| bool show_logout_button_in_tray_; |
| + base::TimeDelta dialog_duration_; |
| + |
| + scoped_ptr<LogoutConfirmationDialogView> confirmation_dialog_; |
| + base::WeakPtrFactory<LogoutButtonTray> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(LogoutButtonTray); |
| }; |