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

Side by Side Diff: ui/message_center/message_center_impl.cc

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.h ('k') | ui/message_center/popup_timer.h » ('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 #include "ui/message_center/message_center_impl.h" 5 #include "ui/message_center/message_center_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 const base::TimeDelta& expires_in) { 810 const base::TimeDelta& expires_in) {
811 if (quiet_mode_timer_) { 811 if (quiet_mode_timer_) {
812 // Note that the capital Reset() is the method to restart the timer, not 812 // Note that the capital Reset() is the method to restart the timer, not
813 // scoped_ptr::reset(). 813 // scoped_ptr::reset().
814 quiet_mode_timer_->Reset(); 814 quiet_mode_timer_->Reset();
815 } else { 815 } else {
816 notification_list_->SetQuietMode(true); 816 notification_list_->SetQuietMode(true);
817 FOR_EACH_OBSERVER( 817 FOR_EACH_OBSERVER(
818 MessageCenterObserver, observer_list_, OnQuietModeChanged(true)); 818 MessageCenterObserver, observer_list_, OnQuietModeChanged(true));
819 819
820 quiet_mode_timer_.reset(new base::OneShotTimer<MessageCenterImpl>); 820 quiet_mode_timer_.reset(new base::OneShotTimer);
821 quiet_mode_timer_->Start( 821 quiet_mode_timer_->Start(
822 FROM_HERE, 822 FROM_HERE,
823 expires_in, 823 expires_in,
824 base::Bind( 824 base::Bind(
825 &MessageCenterImpl::SetQuietMode, base::Unretained(this), false)); 825 &MessageCenterImpl::SetQuietMode, base::Unretained(this), false));
826 } 826 }
827 } 827 }
828 828
829 void MessageCenterImpl::RestartPopupTimers() { 829 void MessageCenterImpl::RestartPopupTimers() {
830 if (popup_timers_controller_) 830 if (popup_timers_controller_)
831 popup_timers_controller_->StartAll(); 831 popup_timers_controller_->StartAll();
832 } 832 }
833 833
834 void MessageCenterImpl::PausePopupTimers() { 834 void MessageCenterImpl::PausePopupTimers() {
835 if (popup_timers_controller_) 835 if (popup_timers_controller_)
836 popup_timers_controller_->PauseAll(); 836 popup_timers_controller_->PauseAll();
837 } 837 }
838 838
839 void MessageCenterImpl::DisableTimersForTest() { 839 void MessageCenterImpl::DisableTimersForTest() {
840 popup_timers_controller_.reset(); 840 popup_timers_controller_.reset();
841 } 841 }
842 842
843 } // namespace message_center 843 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/message_center_impl.h ('k') | ui/message_center/popup_timer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698