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

Unified Diff: chrome/browser/chromeos/cros_settings.cc

Issue 2935011: Initial accounts options page. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: use ListItem directly for now per arv Created 10 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/cros_settings.h ('k') | chrome/browser/chromeos/cros_settings_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/cros_settings.cc
diff --git a/chrome/browser/chromeos/cros_settings.cc b/chrome/browser/chromeos/cros_settings.cc
new file mode 100644
index 0000000000000000000000000000000000000000..852ad9d48fe1ab60c01ba35d9b1dcb467ad96125
--- /dev/null
+++ b/chrome/browser/chromeos/cros_settings.cc
@@ -0,0 +1,75 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/chromeos/cros_settings.h"
+
+#include "base/singleton.h"
+#include "base/string_util.h"
+#include "chrome/browser/chromeos/mock_cros_settings.h"
+
+namespace chromeos {
+
+CrosSettings* CrosSettings::Get() {
+ // TODO(xiyaun): Use real stuff when underlying libcros is ready.
+ return Singleton<MockCrosSettings>::get();
+}
+
+bool CrosSettings::IsCrosSettings(const std::wstring& path) {
+ return StartsWith(path, kCrosSettingsPrefix, true);
+}
+
+void CrosSettings::SetBoolean(const std::wstring& path, bool in_value) {
+ Set(path, Value::CreateBooleanValue(in_value));
+}
+
+void CrosSettings::SetInteger(const std::wstring& path, int in_value) {
+ Set(path, Value::CreateIntegerValue(in_value));
+}
+
+void CrosSettings::SetReal(const std::wstring& path, double in_value) {
+ Set(path, Value::CreateRealValue(in_value));
+}
+
+void CrosSettings::SetString(const std::wstring& path,
+ const std::string& in_value) {
+ Set(path, Value::CreateStringValue(in_value));
+}
+
+bool CrosSettings::GetBoolean(const std::wstring& path,
+ bool* bool_value) const {
+ Value* value;
+ if (!Get(path, &value))
+ return false;
+
+ return value->GetAsBoolean(bool_value);
+}
+
+bool CrosSettings::GetInteger(const std::wstring& path,
+ int* out_value) const {
+ Value* value;
+ if (!Get(path, &value))
+ return false;
+
+ return value->GetAsInteger(out_value);
+}
+
+bool CrosSettings::GetReal(const std::wstring& path,
+ double* out_value) const {
+ Value* value;
+ if (!Get(path, &value))
+ return false;
+
+ return value->GetAsReal(out_value);
+}
+
+bool CrosSettings::GetString(const std::wstring& path,
+ std::string* out_value) const {
+ Value* value;
+ if (!Get(path, &value))
+ return false;
+
+ return value->GetAsString(out_value);
+}
+
+} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/cros_settings.h ('k') | chrome/browser/chromeos/cros_settings_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698