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

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

Issue 2815093006: Stop notification updates from unpausing toast timers. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | ui/message_center/popup_timers_controller.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 <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 23 matching lines...) Expand all
34 ~PopupTimer(); 34 ~PopupTimer();
35 35
36 // Starts running the timer. Barring a Pause or Reset call, the timer will 36 // Starts running the timer. Barring a Pause or Reset call, the timer will
37 // call back to |delegate| after |timeout| seconds. 37 // call back to |delegate| after |timeout| seconds.
38 void Start(); 38 void Start();
39 39
40 // Stops the timer, and retains the amount of time that has passed so that on 40 // Stops the timer, and retains the amount of time that has passed so that on
41 // subsequent calls to Start the timer will continue where it left off. 41 // subsequent calls to Start the timer will continue where it left off.
42 void Pause(); 42 void Pause();
43 43
44 // Returns whether the underlying timer is running or not.
45 bool IsRunning() { return timer_->IsRunning(); }
46
44 private: 47 private:
45 // Notification ID for which this timer applies. 48 // Notification ID for which this timer applies.
46 const std::string id_; 49 const std::string id_;
47 50
48 // Total time that should pass while active before calling TimerFinished. 51 // Total time that should pass while active before calling TimerFinished.
49 base::TimeDelta timeout_; 52 base::TimeDelta timeout_;
50 53
51 // If paused, the amount of time that passed before pause. 54 // If paused, the amount of time that passed before pause.
52 base::TimeDelta passed_; 55 base::TimeDelta passed_;
53 56
54 // The time that the timer was last started. 57 // The time that the timer was last started.
55 base::Time start_time_; 58 base::Time start_time_;
56 59
57 // Callback recipient. 60 // Callback recipient.
58 base::WeakPtr<Delegate> timer_delegate_; 61 base::WeakPtr<Delegate> timer_delegate_;
59 62
60 // The actual timer. 63 // The actual timer.
61 std::unique_ptr<base::OneShotTimer> timer_; 64 std::unique_ptr<base::OneShotTimer> timer_;
62 65
63 DISALLOW_COPY_AND_ASSIGN(PopupTimer); 66 DISALLOW_COPY_AND_ASSIGN(PopupTimer);
64 }; 67 };
65 68
66 } // namespace message_center 69 } // namespace message_center
67 70
68 #endif // UI_MESSAGE_CENTER_POPUP_TIMER_H_ 71 #endif // UI_MESSAGE_CENTER_POPUP_TIMER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/message_center/popup_timers_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698