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

Side by Side Diff: chrome/browser/chromeos/session_length_limiter.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, 3 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/session_length_limiter.h" 5 #include "chrome/browser/chromeos/session_length_limiter.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 (delegate_->GetCurrentTime() - session_start_time_); 197 (delegate_->GetCurrentTime() - session_start_time_);
198 198
199 // Log out the user immediately if the session length limit has been reached 199 // Log out the user immediately if the session length limit has been reached
200 // or exceeded. 200 // or exceeded.
201 if (remaining <= base::TimeDelta()) { 201 if (remaining <= base::TimeDelta()) {
202 delegate_->StopSession(); 202 delegate_->StopSession();
203 return; 203 return;
204 } 204 }
205 205
206 // Set a timer to log out the user when the session length limit is reached. 206 // Set a timer to log out the user when the session length limit is reached.
207 timer_.reset(new base::OneShotTimer<SessionLengthLimiter::Delegate>); 207 timer_.reset(new base::OneShotTimer);
208 timer_->Start(FROM_HERE, remaining, delegate_.get(), 208 timer_->Start(FROM_HERE, remaining, delegate_.get(),
209 &SessionLengthLimiter::Delegate::StopSession); 209 &SessionLengthLimiter::Delegate::StopSession);
210 } 210 }
211 211
212 } // namespace chromeos 212 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/session_length_limiter.h ('k') | chrome/browser/chromeos/system/automatic_reboot_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698