OLD | NEW |
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/chromeos/user_cros_settings_provider.h" | 5 #include "chrome/browser/chromeos/user_cros_settings_provider.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 // upper bound for number of retries to fetch a signed setting. | 251 // upper bound for number of retries to fetch a signed setting. |
252 static const int kNumRetriesLimit = 9; | 252 static const int kNumRetriesLimit = 9; |
253 | 253 |
254 UserCrosSettingsTrust() | 254 UserCrosSettingsTrust() |
255 : ownership_service_(OwnershipService::GetSharedInstance()), | 255 : ownership_service_(OwnershipService::GetSharedInstance()), |
256 retries_left_(kNumRetriesLimit) { | 256 retries_left_(kNumRetriesLimit) { |
257 // Start prefetching Boolean and String preferences. | 257 // Start prefetching Boolean and String preferences. |
258 Reload(); | 258 Reload(); |
259 } | 259 } |
260 | 260 |
261 ~UserCrosSettingsTrust() { | 261 virtual ~UserCrosSettingsTrust() { |
262 if (BrowserThread::CurrentlyOn(BrowserThread::UI) && | 262 if (BrowserThread::CurrentlyOn(BrowserThread::UI) && |
263 CrosLibrary::Get()->EnsureLoaded()) { | 263 CrosLibrary::Get()->EnsureLoaded()) { |
264 // Cancels all pending callbacks from us. | 264 // Cancels all pending callbacks from us. |
265 SignedSettingsHelper::Get()->CancelCallback(this); | 265 SignedSettingsHelper::Get()->CancelCallback(this); |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 // Called right before boolean property is changed. | 269 // Called right before boolean property is changed. |
270 void OnBooleanPropertyChange(const std::string& path, bool new_value) { | 270 void OnBooleanPropertyChange(const std::string& path, bool new_value) { |
271 if (path == kSignedDataRoamingEnabled) { | 271 if (path == kSignedDataRoamingEnabled) { |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 if (cached_whitelist_update->Remove(email_value) != -1) | 601 if (cached_whitelist_update->Remove(email_value) != -1) |
602 prefs->ScheduleSavePersistentPrefs(); | 602 prefs->ScheduleSavePersistentPrefs(); |
603 } | 603 } |
604 | 604 |
605 // static | 605 // static |
606 void UserCrosSettingsProvider::UpdateCachedOwner(const std::string& email) { | 606 void UserCrosSettingsProvider::UpdateCachedOwner(const std::string& email) { |
607 UpdateCacheString(kDeviceOwner, email, USE_VALUE_SUPPLIED); | 607 UpdateCacheString(kDeviceOwner, email, USE_VALUE_SUPPLIED); |
608 } | 608 } |
609 | 609 |
610 } // namespace chromeos | 610 } // namespace chromeos |
OLD | NEW |