Chromium Code Reviews| Index: chrome/browser/chromeos/ui/idle_logout_dialog.h |
| diff --git a/chrome/browser/chromeos/ui/idle_logout_dialog.h b/chrome/browser/chromeos/ui/idle_logout_dialog.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d46e7231eef970f6819f3cf6fb947026b86188de |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/ui/idle_logout_dialog.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_UI_IDLE_LOGOUT_DIALOG_H_ |
| +#define CHROME_BROWSER_CHROMEOS_UI_IDLE_LOGOUT_DIALOG_H_ |
| +#pragma once |
| + |
| +#include <string> |
| +#include <vector> |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/string16.h" |
| +#include "base/timer.h" |
| +#include "ui/views/controls/label.h" |
| +#include "ui/views/window/dialog_delegate.h" |
| + |
| +namespace base { |
| + class TimeDelta; |
|
sky
2012/03/11 21:57:47
don't indent this.
rkc
2012/03/12 22:43:38
Done.
|
| +} |
| + |
| +// A class to show the logout on idle dialog if the machine is in retail mode. |
| +class IdleLogoutDialog : public views::DialogDelegateView { |
| + public: |
| + static void ShowIdleLogoutDialog(); |
| + static void CloseIdleLogoutDialog(); |
| + |
| + // views::DialogDelegateView: |
| + virtual int GetDialogButtons() const OVERRIDE; |
| + virtual ui::ModalType GetModalType() const OVERRIDE; |
| +// virtual bool CanResize() const OVERRIDE; |
|
sky
2012/03/11 21:57:47
If you don't want to override this, remove it.
Als
rkc
2012/03/12 22:43:38
Ouch, missed this one in cleanup. Removed.
Done.
|
| + virtual string16 GetWindowTitle() const OVERRIDE; |
| + virtual views::View* GetContentsView() OVERRIDE; |
| + |
| + // views::View: |
| + virtual void Layout() OVERRIDE; |
| + virtual gfx::Size GetPreferredSize() OVERRIDE; |
| + |
|
sky
2012/03/11 21:57:47
nit: only one empty line.
rkc
2012/03/12 22:43:38
Done.
|
| + |
| + private: |
| + IdleLogoutDialog(); |
| + |
| + // Adds the labels and adds them to the layout. |
| + void Init(); |
| + |
| + void Show(); |
| + void Close(); |
| + |
| + void UpdateCountdownTimer(); |
| + |
| + views::Label* warning_label_; |
| + views::Label* restart_label_; |
| + |
| + // Time at which the countdown is over and we should close the dialog. |
| + base::Time countdown_end_time_; |
| + |
| + base::RepeatingTimer<IdleLogoutDialog> timer_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(IdleLogoutDialog); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_UI_IDLE_LOGOUT_DIALOG_H_ |