Index: ash/system/logout_confirmation/logout_confirmation_dialog.h |
diff --git a/ash/system/logout_confirmation/logout_confirmation_dialog.h b/ash/system/logout_confirmation/logout_confirmation_dialog.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..dbc88a8ea0afc8efdafe63a4e6282bb468698606 |
--- /dev/null |
+++ b/ash/system/logout_confirmation/logout_confirmation_dialog.h |
@@ -0,0 +1,59 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef ASH_SYSTEM_LOGOUT_CONFIRMATION_LOGOUT_CONFIRMATION_DIALOG_H_ |
+#define ASH_SYSTEM_LOGOUT_CONFIRMATION_LOGOUT_CONFIRMATION_DIALOG_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/compiler_specific.h" |
+#include "base/time/time.h" |
+#include "base/timer/timer.h" |
+#include "ui/views/window/dialog_delegate.h" |
+ |
+namespace views { |
+class Label; |
+} |
+ |
+namespace ash { |
+namespace internal { |
+ |
+class LogoutConfirmationController; |
+ |
+// A dialog that asks the user to confirm or deny logout. The dialog shows a |
+// countdown and informs the user that a logout will happen automatically if no |
+// choice is made before the countdown has expired. |
+class LogoutConfirmationDialog : public views::DialogDelegateView { |
+ public: |
+ LogoutConfirmationDialog(LogoutConfirmationController* controller, |
+ base::TimeTicks logout_time); |
+ virtual ~LogoutConfirmationDialog(); |
+ |
+ void Update(base::TimeTicks logout_time); |
+ |
+ // views::DialogDelegateView: |
+ virtual bool Accept() OVERRIDE; |
+ virtual ui::ModalType GetModalType() const OVERRIDE; |
+ virtual base::string16 GetWindowTitle() const OVERRIDE; |
+ virtual base::string16 |
+ GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; |
stevenjb
2014/02/27 17:58:44
clang format says:
virtual base::string16 GetDial
bartfab (slow)
2014/02/28 12:13:49
Either one is allowed by the style guide. I have n
|
+ virtual void OnClosed() OVERRIDE; |
+ virtual void DeleteDelegate() OVERRIDE; |
+ |
+ private: |
+ void UpdateLabel(); |
+ |
+ LogoutConfirmationController* controller_; |
+ base::TimeTicks logout_time_; |
+ |
+ views::Label* label_; |
+ |
+ base::RepeatingTimer<LogoutConfirmationDialog> update_timer_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(LogoutConfirmationDialog); |
+}; |
+ |
+} // namespace internal |
+} // namespace ash |
+ |
+#endif // ASH_SYSTEM_LOGOUT_CONFIRMATION_LOGOUT_CONFIRMATION_DIALOG_H_ |