Chromium Code Reviews| Index: ash/system/logout_button/logout_confirmation_dialog_view.h |
| diff --git a/ash/system/logout_button/logout_confirmation_dialog_view.h b/ash/system/logout_button/logout_confirmation_dialog_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c6262906330ba4b84fb2833b27e129fb120eb801 |
| --- /dev/null |
| +++ b/ash/system/logout_button/logout_confirmation_dialog_view.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright (c) 2013 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_BUTTON_LOGOUT_CONFIRMATION_DIALOG_VIEW_H_ |
| +#define ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_CONFIRMATION_DIALOG_VIEW_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/compiler_specific.h" |
| +#include "base/memory/weak_ptr.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 LogoutButtonTray; |
| + |
| +// This class implements dialog view for logout confirmation, supposed to be |
|
bartfab (slow)
2013/10/28 16:24:07
I do not think the part "supposed to be used by lo
binjin
2013/10/29 16:07:05
Done.
|
| +// used by logout button tray directly. |
| +class LogoutConfirmationDialogView : public views::DialogDelegateView { |
| + public: |
| + base::WeakPtr<LogoutConfirmationDialogView> GetWeakPtr(); |
|
bartfab (slow)
2013/10/28 16:24:07
SupportsWeakPtr provides this. But as commented el
binjin
2013/10/29 16:07:05
Done.
|
| + |
| + // views::DialogDelegateView: |
| + virtual bool Accept() OVERRIDE; |
| + virtual ui::ModalType GetModalType() const OVERRIDE; |
| + virtual string16 GetWindowTitle() const OVERRIDE; |
| + virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; |
| + |
| + LogoutConfirmationDialogView(); |
|
bartfab (slow)
2013/10/28 16:24:07
The constructor and destructor should be the first
binjin
2013/10/29 16:07:05
Done.
|
| + virtual ~LogoutConfirmationDialogView(); |
| + void Show(base::TimeDelta duration); |
| + void UpdateCountdown(); |
| + |
| + private: |
| + views::Label* text_label_; |
| + |
| + base::TimeTicks countdown_end_time_; |
|
bartfab (slow)
2013/10/28 16:24:07
Instead of having to pass the time to the dialog a
binjin
2013/10/29 16:07:05
I think the current approach is fine. The life tim
|
| + |
| + base::RepeatingTimer<LogoutConfirmationDialogView> timer_; |
| + |
| + base::WeakPtrFactory<LogoutConfirmationDialogView> weak_factory_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(LogoutConfirmationDialogView); |
| +}; |
| + |
| +} // namespace internal |
| + |
| +} // namespace ash |
| + |
| +#endif // ASH_SYSTEM_LOGOUT_BUTTON_LOGOUT_CONFIRMATION_DIALOG_VIEW_H_ |
| + |