OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 UI_MESSAGE_CENTER_POPUP_TIMER_H_ | 5 #ifndef UI_MESSAGE_CENTER_POPUP_TIMER_H_ |
6 #define UI_MESSAGE_CENTER_POPUP_TIMER_H_ | 6 #define UI_MESSAGE_CENTER_POPUP_TIMER_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <string> | 9 #include <string> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "base/timer/timer.h" | 14 #include "base/timer/timer.h" |
15 | 15 |
16 namespace message_center { | 16 namespace message_center { |
17 | 17 |
18 // A class that manages timeout behavior for notification popups. One instance | 18 // A class that manages timeout behavior for notification popups. One instance |
19 // is created per notification popup. | 19 // is created per notification popup. |
20 class PopupTimer { | 20 class PopupTimer { |
21 public: | 21 public: |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // If paused, the amount of time that passed before pause. | 57 // If paused, the amount of time that passed before pause. |
58 base::TimeDelta passed_; | 58 base::TimeDelta passed_; |
59 | 59 |
60 // The time that the timer was last started. | 60 // The time that the timer was last started. |
61 base::Time start_time_; | 61 base::Time start_time_; |
62 | 62 |
63 // Callback recipient. | 63 // Callback recipient. |
64 base::WeakPtr<Delegate> timer_delegate_; | 64 base::WeakPtr<Delegate> timer_delegate_; |
65 | 65 |
66 // The actual timer. | 66 // The actual timer. |
67 scoped_ptr<base::OneShotTimer> timer_; | 67 std::unique_ptr<base::OneShotTimer> timer_; |
68 | 68 |
69 DISALLOW_COPY_AND_ASSIGN(PopupTimer); | 69 DISALLOW_COPY_AND_ASSIGN(PopupTimer); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace message_center | 72 } // namespace message_center |
73 | 73 |
74 #endif // UI_MESSAGE_CENTER_POPUP_TIMER_H_ | 74 #endif // UI_MESSAGE_CENTER_POPUP_TIMER_H_ |
OLD | NEW |