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

Side by Side Diff: chrome/browser/profiles/gaia_info_update_service.cc

Issue 10828345: Extract PrefServiceBase into chrome/browser/api. Use in api and autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head Created 8 years, 4 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 | Annotate | Revision Log
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/profiles/gaia_info_update_service.h" 5 #include "chrome/browser/profiles/gaia_info_update_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/prefs/pref_service.h" 9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (CommandLine::ForCurrentProcess()->HasSwitch( 69 if (CommandLine::ForCurrentProcess()->HasSwitch(
70 switches::kGaiaProfileInfo)) { 70 switches::kGaiaProfileInfo)) {
71 return true; 71 return true;
72 } 72 }
73 73
74 // This feature is disable by default. 74 // This feature is disable by default.
75 return false; 75 return false;
76 } 76 }
77 77
78 // static 78 // static
79 void GAIAInfoUpdateService::RegisterUserPrefs(PrefService* prefs) { 79 void GAIAInfoUpdateService::RegisterUserPrefs(PrefServiceBase* prefs) {
80 prefs->RegisterInt64Pref( 80 prefs->RegisterInt64Pref(
81 prefs::kProfileGAIAInfoUpdateTime, 0, PrefService::UNSYNCABLE_PREF); 81 prefs::kProfileGAIAInfoUpdateTime, 0, PrefServiceBase::UNSYNCABLE_PREF);
82 prefs->RegisterStringPref( 82 prefs->RegisterStringPref(
83 prefs::kProfileGAIAInfoPictureURL, "", PrefService::UNSYNCABLE_PREF); 83 prefs::kProfileGAIAInfoPictureURL, "", PrefServiceBase::UNSYNCABLE_PREF);
84 } 84 }
85 85
86 bool GAIAInfoUpdateService::NeedsProfilePicture() const { 86 bool GAIAInfoUpdateService::NeedsProfilePicture() const {
87 return true; 87 return true;
88 } 88 }
89 89
90 int GAIAInfoUpdateService::GetDesiredImageSideLength() const { 90 int GAIAInfoUpdateService::GetDesiredImageSideLength() const {
91 return 256; 91 return 256;
92 } 92 }
93 93
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 const base::TimeDelta update_delta = base::Time::Now() - last_updated_; 211 const base::TimeDelta update_delta = base::Time::Now() - last_updated_;
212 212
213 base::TimeDelta delta; 213 base::TimeDelta delta;
214 if (update_delta < base::TimeDelta() || update_delta > desired_delta) 214 if (update_delta < base::TimeDelta() || update_delta > desired_delta)
215 delta = base::TimeDelta::FromSeconds(kMinUpdateIntervalSeconds); 215 delta = base::TimeDelta::FromSeconds(kMinUpdateIntervalSeconds);
216 else 216 else
217 delta = desired_delta - update_delta; 217 delta = desired_delta - update_delta;
218 218
219 timer_.Start(FROM_HERE, delta, this, &GAIAInfoUpdateService::Update); 219 timer_.Start(FROM_HERE, delta, this, &GAIAInfoUpdateService::Update);
220 } 220 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/gaia_info_update_service.h ('k') | chrome/browser/profiles/off_the_record_profile_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698