| 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/chromeos/settings/cros_settings.h" | 5 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 AddSettingsProvider(new StubCrosSettingsProvider(notify_cb)); | 76 AddSettingsProvider(new StubCrosSettingsProvider(notify_cb)); |
| 77 } else { | 77 } else { |
| 78 AddSettingsProvider( | 78 AddSettingsProvider( |
| 79 new DeviceSettingsProvider(notify_cb, device_settings_service)); | 79 new DeviceSettingsProvider(notify_cb, device_settings_service)); |
| 80 } | 80 } |
| 81 // System settings are not mocked currently. | 81 // System settings are not mocked currently. |
| 82 AddSettingsProvider(new SystemSettingsProvider(notify_cb)); | 82 AddSettingsProvider(new SystemSettingsProvider(notify_cb)); |
| 83 } | 83 } |
| 84 | 84 |
| 85 CrosSettings::~CrosSettings() { | 85 CrosSettings::~CrosSettings() { |
| 86 STLDeleteElements(&providers_); | 86 base::STLDeleteElements(&providers_); |
| 87 STLDeleteValues(&settings_observers_); | 87 base::STLDeleteValues(&settings_observers_); |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool CrosSettings::IsCrosSettings(const std::string& path) { | 90 bool CrosSettings::IsCrosSettings(const std::string& path) { |
| 91 return base::StartsWith(path, kCrosSettingsPrefix, | 91 return base::StartsWith(path, kCrosSettingsPrefix, |
| 92 base::CompareCase::SENSITIVE); | 92 base::CompareCase::SENSITIVE); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void CrosSettings::Set(const std::string& path, const base::Value& in_value) { | 95 void CrosSettings::Set(const std::string& path, const base::Value& in_value) { |
| 96 DCHECK(CalledOnValidThread()); | 96 DCHECK(CalledOnValidThread()); |
| 97 CrosSettingsProvider* provider; | 97 CrosSettingsProvider* provider; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 | 343 |
| 344 ScopedTestCrosSettings::ScopedTestCrosSettings() { | 344 ScopedTestCrosSettings::ScopedTestCrosSettings() { |
| 345 CrosSettings::Initialize(); | 345 CrosSettings::Initialize(); |
| 346 } | 346 } |
| 347 | 347 |
| 348 ScopedTestCrosSettings::~ScopedTestCrosSettings() { | 348 ScopedTestCrosSettings::~ScopedTestCrosSettings() { |
| 349 CrosSettings::Shutdown(); | 349 CrosSettings::Shutdown(); |
| 350 } | 350 } |
| 351 | 351 |
| 352 } // namespace chromeos | 352 } // namespace chromeos |
| OLD | NEW |