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

Side by Side Diff: chrome/browser/web_resource/promo_resource_service.cc

Issue 9185026: Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Explicitly include base/time.h in header file. Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/web_resource/promo_resource_service.h" 5 #include "chrome/browser/web_resource/promo_resource_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/rand_util.h" 8 #include "base/rand_util.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 void PromoResourceService::PostNotification(int64 delay_ms) { 211 void PromoResourceService::PostNotification(int64 delay_ms) {
212 if (web_resource_update_scheduled_) 212 if (web_resource_update_scheduled_)
213 return; 213 return;
214 if (delay_ms > 0) { 214 if (delay_ms > 0) {
215 web_resource_update_scheduled_ = true; 215 web_resource_update_scheduled_ = true;
216 MessageLoop::current()->PostDelayedTask( 216 MessageLoop::current()->PostDelayedTask(
217 FROM_HERE, 217 FROM_HERE,
218 base::Bind(&PromoResourceService::PromoResourceStateChange, 218 base::Bind(&PromoResourceService::PromoResourceStateChange,
219 weak_ptr_factory_.GetWeakPtr()), 219 weak_ptr_factory_.GetWeakPtr()),
220 delay_ms); 220 base::TimeDelta::FromMilliseconds(delay_ms));
221 } else if (delay_ms == 0) { 221 } else if (delay_ms == 0) {
222 PromoResourceStateChange(); 222 PromoResourceStateChange();
223 } 223 }
224 } 224 }
225 225
226 void PromoResourceService::PromoResourceStateChange() { 226 void PromoResourceService::PromoResourceStateChange() {
227 web_resource_update_scheduled_ = false; 227 web_resource_update_scheduled_ = false;
228 content::NotificationService* service = 228 content::NotificationService* service =
229 content::NotificationService::current(); 229 content::NotificationService::current();
230 service->Notify(chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED, 230 service->Notify(chrome::NOTIFICATION_PROMO_RESOURCE_STATE_CHANGED,
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 if (!prefs->HasPrefPath(prefs::kNTPSignInPromoGroup)) { 479 if (!prefs->HasPrefPath(prefs::kNTPSignInPromoGroup)) {
480 prefs->SetInteger(prefs::kNTPSignInPromoGroup, 480 prefs->SetInteger(prefs::kNTPSignInPromoGroup,
481 base::RandInt(1, kNTPSignInPromoNumberOfGroups)); 481 base::RandInt(1, kNTPSignInPromoNumberOfGroups));
482 } 482 }
483 483
484 // A response is not kept if the build wasn't targeted, so the only thing 484 // A response is not kept if the build wasn't targeted, so the only thing
485 // required to check is the group this client has been tagged in. 485 // required to check is the group this client has been tagged in.
486 return prefs->GetInteger(prefs::kNTPSignInPromoGroupMax) >= 486 return prefs->GetInteger(prefs::kNTPSignInPromoGroupMax) >=
487 prefs->GetInteger(prefs::kNTPSignInPromoGroup); 487 prefs->GetInteger(prefs::kNTPSignInPromoGroup);
488 } 488 }
OLDNEW
« no previous file with comments | « chrome/browser/visitedlink/visitedlink_unittest.cc ('k') | chrome/browser/web_resource/web_resource_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698