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

Side by Side Diff: chrome/browser/signin/cross_device_promo.cc

Issue 1545223002: Switch to standard integer types in chrome/browser/, part 4 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 12 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/signin/cross_device_promo.h" 5 #include "chrome/browser/signin/cross_device_promo.h"
6 6
7 #include <stdint.h>
8
7 #include "base/metrics/histogram_macros.h" 9 #include "base/metrics/histogram_macros.h"
8 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
9 #include "base/rand_util.h" 11 #include "base/rand_util.h"
10 #include "base/strings/string_number_conversions.h" 12 #include "base/strings/string_number_conversions.h"
11 #include "base/time/time.h" 13 #include "base/time/time.h"
12 #include "chrome/common/pref_names.h" 14 #include "chrome/common/pref_names.h"
13 #include "components/signin/core/browser/signin_client.h" 15 #include "components/signin/core/browser/signin_client.h"
14 #include "components/signin/core/browser/signin_manager.h" 16 #include "components/signin/core/browser/signin_manager.h"
15 #include "components/signin/core/browser/signin_metrics.h" 17 #include "components/signin/core/browser/signin_metrics.h"
16 #include "components/variations/variations_associated_data.h" 18 #include "components/variations/variations_associated_data.h"
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 single_account_duration_threshold_ > base::Time::Now())) { 316 single_account_duration_threshold_ > base::Time::Now())) {
315 signin_metrics::LogXDevicePromoEligible( 317 signin_metrics::LogXDevicePromoEligible(
316 signin_metrics::NOT_SINGLE_GAIA_ACCOUNT); 318 signin_metrics::NOT_SINGLE_GAIA_ACCOUNT);
317 return false; 319 return false;
318 } 320 }
319 321
320 if (!prefs_->HasPrefPath(prefs::kCrossDevicePromoNextFetchListDevicesTime)) { 322 if (!prefs_->HasPrefPath(prefs::kCrossDevicePromoNextFetchListDevicesTime)) {
321 // The missing preference indicates CheckPromoEligibility() has never been 323 // The missing preference indicates CheckPromoEligibility() has never been
322 // called. Determine when to call the DeviceActivityFetcher for the first 324 // called. Determine when to call the DeviceActivityFetcher for the first
323 // time. 325 // time.
324 const uint64 milliseconds_until_next_activity_fetch = base::RandGenerator( 326 const uint64_t milliseconds_until_next_activity_fetch = base::RandGenerator(
325 delay_until_next_device_activity_fetch_.InMilliseconds()); 327 delay_until_next_device_activity_fetch_.InMilliseconds());
326 const base::Time time_of_next_device_activity_fetch = base::Time::Now() + 328 const base::Time time_of_next_device_activity_fetch = base::Time::Now() +
327 base::TimeDelta::FromMilliseconds( 329 base::TimeDelta::FromMilliseconds(
328 milliseconds_until_next_activity_fetch); 330 milliseconds_until_next_activity_fetch);
329 SetTimePref(prefs::kCrossDevicePromoNextFetchListDevicesTime, 331 SetTimePref(prefs::kCrossDevicePromoNextFetchListDevicesTime,
330 time_of_next_device_activity_fetch); 332 time_of_next_device_activity_fetch);
331 signin_metrics::LogXDevicePromoEligible( 333 signin_metrics::LogXDevicePromoEligible(
332 signin_metrics::UNKNOWN_COUNT_DEVICES); 334 signin_metrics::UNKNOWN_COUNT_DEVICES);
333 return false; 335 return false;
334 } 336 }
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 device_activity_fetcher_->Start(); 449 device_activity_fetcher_->Start();
448 } 450 }
449 451
450 void CrossDevicePromo::RegisterForCookieChanges() { 452 void CrossDevicePromo::RegisterForCookieChanges() {
451 cookie_manager_service_->AddObserver(this); 453 cookie_manager_service_->AddObserver(this);
452 } 454 }
453 455
454 void CrossDevicePromo::UnregisterForCookieChanges() { 456 void CrossDevicePromo::UnregisterForCookieChanges() {
455 cookie_manager_service_->RemoveObserver(this); 457 cookie_manager_service_->RemoveObserver(this);
456 } 458 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/cross_device_promo.h ('k') | chrome/browser/signin/cross_device_promo_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698