| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // System settings are not mocked currently. | 79 // System settings are not mocked currently. |
| 80 AddSettingsProvider(new SystemSettingsProvider(notify_cb)); | 80 AddSettingsProvider(new SystemSettingsProvider(notify_cb)); |
| 81 } | 81 } |
| 82 | 82 |
| 83 CrosSettings::~CrosSettings() { | 83 CrosSettings::~CrosSettings() { |
| 84 STLDeleteElements(&providers_); | 84 STLDeleteElements(&providers_); |
| 85 STLDeleteValues(&settings_observers_); | 85 STLDeleteValues(&settings_observers_); |
| 86 } | 86 } |
| 87 | 87 |
| 88 bool CrosSettings::IsCrosSettings(const std::string& path) { | 88 bool CrosSettings::IsCrosSettings(const std::string& path) { |
| 89 return StartsWithASCII(path, kCrosSettingsPrefix, true); | 89 return base::StartsWithASCII(path, kCrosSettingsPrefix, true); |
| 90 } | 90 } |
| 91 | 91 |
| 92 void CrosSettings::Set(const std::string& path, const base::Value& in_value) { | 92 void CrosSettings::Set(const std::string& path, const base::Value& in_value) { |
| 93 DCHECK(CalledOnValidThread()); | 93 DCHECK(CalledOnValidThread()); |
| 94 CrosSettingsProvider* provider; | 94 CrosSettingsProvider* provider; |
| 95 provider = GetProvider(path); | 95 provider = GetProvider(path); |
| 96 if (provider) | 96 if (provider) |
| 97 provider->Set(path, in_value); | 97 provider->Set(path, in_value); |
| 98 } | 98 } |
| 99 | 99 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 340 |
| 341 ScopedTestCrosSettings::ScopedTestCrosSettings() { | 341 ScopedTestCrosSettings::ScopedTestCrosSettings() { |
| 342 CrosSettings::Initialize(); | 342 CrosSettings::Initialize(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 ScopedTestCrosSettings::~ScopedTestCrosSettings() { | 345 ScopedTestCrosSettings::~ScopedTestCrosSettings() { |
| 346 CrosSettings::Shutdown(); | 346 CrosSettings::Shutdown(); |
| 347 } | 347 } |
| 348 | 348 |
| 349 } // namespace chromeos | 349 } // namespace chromeos |
| OLD | NEW |