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..1c70ab19a58bb261e0a4ec5ea352f2a30ad0abb9 100644 |
| --- a/ash/system/logout_button/logout_button_tray.h |
| +++ b/ash/system/logout_button/logout_button_tray.h |
| @@ -5,11 +5,16 @@ |
| #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/memory/weak_ptr.h" |
| +#include "base/time/time.h" |
| #include "ui/views/controls/button/button.h" |
| namespace views { |
| @@ -20,16 +25,23 @@ namespace ash { |
| namespace internal { |
| class StatusAreaWidget; |
| +class LogoutConfirmationDialogTest; |
|
bartfab (slow)
2013/12/10 12:41:16
Nit: This is not needed. Stating that LogoutConfir
binjin
2013/12/12 13:56:55
Done.
|
| // 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); |
| + friend class LogoutConfirmationDialogTest; |
|
bartfab (slow)
2013/12/10 12:41:16
Nit: The friend declaration should go to the start
binjin
2013/12/12 13:56:55
Done.
|
| + LogoutButtonTray(StatusAreaWidget* status_area_widget, |
|
bartfab (slow)
2013/12/10 12:41:16
Nit: Indentation: All arguments must be aligned. I
binjin
2013/12/12 13:56:55
Done.
|
| + LogoutConfirmationDialogView::LogoutConfirmationDelegate* delegate); |
|
bartfab (slow)
2013/12/10 12:41:16
1) You are passing ownership of |delegate| here. U
binjin
2013/12/12 13:56:55
Done.
|
| virtual ~LogoutButtonTray(); |
| + void EnsureConfirmationDialogIsShowing(); |
| + void EnsureConfirmationDialogIsClosed(); |
| + bool IsConfirmationDialogShowing(); |
|
bartfab (slow)
2013/12/10 12:41:16
Nit 1: Getters usually go before setters. Thus, Is
binjin
2013/12/12 13:56:55
Done.
|
| + |
| // TrayBackgroundView: |
| virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; |
| virtual base::string16 GetAccessibleNameForTray() OVERRIDE; |
| @@ -39,6 +51,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 +59,24 @@ class LogoutButtonTray : public TrayBackgroundView, |
| void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
| + void DeleteConfirmationDialog(); |
| + |
| + LogoutConfirmationDialogView* GetConfirmationDialogForTest(); |
| + LogoutConfirmationDialogView::LogoutConfirmationDelegate* |
| + GetConfirmationDelegateForTest(); |
| + |
| 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_; |
| + scoped_ptr<LogoutConfirmationDialogView::LogoutConfirmationDelegate> |
| + confirmation_delegate_; |
| + base::WeakPtrFactory<LogoutButtonTray> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(LogoutButtonTray); |
| }; |