Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(257)

Side by Side Diff: ui/message_center/popup_timer.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/message_center/message_center_impl.cc ('k') | ui/message_center/popup_timer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // If paused, the amount of time that passed before pause. 58 // If paused, the amount of time that passed before pause.
59 base::TimeDelta passed_; 59 base::TimeDelta passed_;
60 60
61 // The time that the timer was last started. 61 // The time that the timer was last started.
62 base::Time start_time_; 62 base::Time start_time_;
63 63
64 // Callback recipient. 64 // Callback recipient.
65 base::WeakPtr<PopupTimersController> timer_controller_; 65 base::WeakPtr<PopupTimersController> timer_controller_;
66 66
67 // The actual timer. 67 // The actual timer.
68 scoped_ptr<base::OneShotTimer<PopupTimersController>> timer_; 68 scoped_ptr<base::OneShotTimer> timer_;
69 69
70 DISALLOW_COPY_AND_ASSIGN(PopupTimer); 70 DISALLOW_COPY_AND_ASSIGN(PopupTimer);
71 }; 71 };
72 72
73 // A class that manages all the timers running for individual notification popup 73 // A class that manages all the timers running for individual notification popup
74 // windows. It supports weak pointers in order to allow safe callbacks when 74 // windows. It supports weak pointers in order to allow safe callbacks when
75 // timers expire. 75 // timers expire.
76 class MESSAGE_CENTER_EXPORT PopupTimersController 76 class MESSAGE_CENTER_EXPORT PopupTimersController
77 : public base::SupportsWeakPtr<PopupTimersController>, 77 : public base::SupportsWeakPtr<PopupTimersController>,
78 public MessageCenterObserver { 78 public MessageCenterObserver {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 typedef base::ScopedPtrMap<std::string, scoped_ptr<PopupTimer>> 121 typedef base::ScopedPtrMap<std::string, scoped_ptr<PopupTimer>>
122 PopupTimerCollection; 122 PopupTimerCollection;
123 PopupTimerCollection popup_timers_; 123 PopupTimerCollection popup_timers_;
124 124
125 DISALLOW_COPY_AND_ASSIGN(PopupTimersController); 125 DISALLOW_COPY_AND_ASSIGN(PopupTimersController);
126 }; 126 };
127 127
128 } // namespace message_center 128 } // namespace message_center
129 129
130 #endif // UI_MESSAGE_CENTER_POPUP_TIMER_H_ 130 #endif // UI_MESSAGE_CENTER_POPUP_TIMER_H_
OLDNEW
« no previous file with comments | « ui/message_center/message_center_impl.cc ('k') | ui/message_center/popup_timer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698