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

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: rebase Created 6 years, 11 months 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
« no previous file with comments | « ash/system/logout_button/logout_button_observer.h ('k') | ash/system/logout_button/logout_button_tray.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..5755835b68bd7ea676a8c433ccaf11013f7fc1f0 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,9 +27,9 @@ 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();
@@ -39,6 +43,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 +51,30 @@ class LogoutButtonTray : public TrayBackgroundView,
void UpdateAfterLoginStatusChange(user::LoginStatus login_status);
+ // Nullify the pointer to confirmation dialog, this is expected to be called
+ // when the confirmation dialog is going to be destroyed.
+ // Note: the confirmation dialog is not owned by LogoutButtonTray.
+ void ReleaseConfirmationDialog();
+
+ void SetDelegateForTest(
+ scoped_ptr<LogoutConfirmationDialogView::Delegate> delegate);
+
private:
+ friend class LogoutConfirmationDialogTest;
+
+ bool IsConfirmationDialogShowing() const;
+ void EnsureConfirmationDialogIsShowing();
+ void EnsureConfirmationDialogIsClosed();
+
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);
};
« no previous file with comments | « ash/system/logout_button/logout_button_observer.h ('k') | ash/system/logout_button/logout_button_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698