| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_POWER_IDLE_ACTION_WARNING_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POWER_IDLE_ACTION_WARNING_DIALOG_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_POWER_IDLE_ACTION_WARNING_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POWER_IDLE_ACTION_WARNING_DIALOG_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // warning is only really necessary when the idle action is to log out the user, | 21 // warning is only really necessary when the idle action is to log out the user, |
| 22 // the warning is hard-coded to warn about logout. | 22 // the warning is hard-coded to warn about logout. |
| 23 class IdleActionWarningDialogView : public views::DialogDelegateView { | 23 class IdleActionWarningDialogView : public views::DialogDelegateView { |
| 24 public: | 24 public: |
| 25 explicit IdleActionWarningDialogView(base::TimeTicks idle_action_time); | 25 explicit IdleActionWarningDialogView(base::TimeTicks idle_action_time); |
| 26 void CloseDialog(); | 26 void CloseDialog(); |
| 27 | 27 |
| 28 void Update(base::TimeTicks idle_action_time); | 28 void Update(base::TimeTicks idle_action_time); |
| 29 | 29 |
| 30 // views::DialogDelegateView: | 30 // views::DialogDelegateView: |
| 31 virtual ui::ModalType GetModalType() const OVERRIDE; | 31 virtual ui::ModalType GetModalType() const override; |
| 32 virtual base::string16 GetWindowTitle() const OVERRIDE; | 32 virtual base::string16 GetWindowTitle() const override; |
| 33 virtual int GetDialogButtons() const OVERRIDE; | 33 virtual int GetDialogButtons() const override; |
| 34 virtual bool Cancel() OVERRIDE; | 34 virtual bool Cancel() override; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 virtual ~IdleActionWarningDialogView(); | 37 virtual ~IdleActionWarningDialogView(); |
| 38 | 38 |
| 39 void UpdateLabel(); | 39 void UpdateLabel(); |
| 40 | 40 |
| 41 base::TimeTicks idle_action_time_; | 41 base::TimeTicks idle_action_time_; |
| 42 | 42 |
| 43 views::Label* label_; | 43 views::Label* label_; |
| 44 | 44 |
| 45 base::RepeatingTimer<IdleActionWarningDialogView> update_timer_; | 45 base::RepeatingTimer<IdleActionWarningDialogView> update_timer_; |
| 46 | 46 |
| 47 DISALLOW_COPY_AND_ASSIGN(IdleActionWarningDialogView); | 47 DISALLOW_COPY_AND_ASSIGN(IdleActionWarningDialogView); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace chromeos | 50 } // namespace chromeos |
| 51 | 51 |
| 52 #endif // CHROME_BROWSER_CHROMEOS_POWER_IDLE_ACTION_WARNING_DIALOG_VIEW_H_ | 52 #endif // CHROME_BROWSER_CHROMEOS_POWER_IDLE_ACTION_WARNING_DIALOG_VIEW_H_ |
| OLD | NEW |