Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3555)

Unified Diff: ash/system/logout_button/logout_button_tray.h

Issue 40053002: Implements the dialog view for logout button tray in public sessions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5f92d37526d8d3c41d24fabb8cace3f9e0c12d91 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);
+ LogoutButtonTray(StatusAreaWidget* status_area_widget);
virtual ~LogoutButtonTray();
+ bool IsConfirmationDialogShowing() const;
+ void EnsureConfirmationDialogIsShowing();
+ void EnsureConfirmationDialogIsClosed();
+
// 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,25 @@ class LogoutButtonTray : public TrayBackgroundView,
void UpdateAfterLoginStatusChange(user::LoginStatus login_status);
+ void DeleteConfirmationDialog();
bartfab (slow) 2013/12/12 16:04:13 The name is misleading. This method does not delet
binjin 2013/12/17 10:29:49 Done.
+
+ LogoutConfirmationDialogView* GetConfirmationDialogForTest();
+ LogoutConfirmationDialogView::Delegate* GetConfirmationDelegateForTest();
+ 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_;
+
+ scoped_ptr<LogoutConfirmationDialogView> confirmation_dialog_;
+ scoped_ptr<LogoutConfirmationDialogView::Delegate> confirmation_delegate_;
DISALLOW_COPY_AND_ASSIGN(LogoutButtonTray);
};

Powered by Google App Engine
This is Rietveld 408576698