| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |