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

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

Issue 10824112: Move Chrome OS device settings stuff to chrome/browser/chromeos/settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 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/system_settings_provider.h ('k') | chrome/browser/policy/app_pack_updater.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/system_settings_provider.cc
diff --git a/chrome/browser/chromeos/system_settings_provider.cc b/chrome/browser/chromeos/system_settings_provider.cc
deleted file mode 100644
index aec6d20037cfc218331ab622806e153a017170b1..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/system_settings_provider.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012 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/system_settings_provider.h"
-
-#include "base/string16.h"
-#include "base/time.h"
-#include "base/values.h"
-#include "chrome/browser/chromeos/cros_settings.h"
-#include "chrome/browser/chromeos/cros_settings_names.h"
-#include "chrome/browser/chromeos/login/user_manager.h"
-#include "grit/generated_resources.h"
-#include "ui/base/l10n/l10n_util.h"
-
-namespace chromeos {
-
-SystemSettingsProvider::SystemSettingsProvider(
- const NotifyObserversCallback& notify_cb)
- : CrosSettingsProvider(notify_cb) {
- system::TimezoneSettings *timezone_settings =
- system::TimezoneSettings::GetInstance();
- timezone_settings->AddObserver(this);
- timezone_value_.reset(base::Value::CreateStringValue(
- timezone_settings->GetCurrentTimezoneID()));
-}
-
-SystemSettingsProvider::~SystemSettingsProvider() {
- system::TimezoneSettings::GetInstance()->RemoveObserver(this);
-}
-
-void SystemSettingsProvider::DoSet(const std::string& path,
- const base::Value& in_value) {
- // Non-guest users can change the time zone.
- if (UserManager::Get()->IsLoggedInAsGuest())
- return;
-
- if (path == kSystemTimezone) {
- string16 timezone_id;
- if (!in_value.GetAsString(&timezone_id))
- return;
- // This will call TimezoneChanged.
- system::TimezoneSettings::GetInstance()->SetTimezoneFromID(timezone_id);
- }
-}
-
-const base::Value* SystemSettingsProvider::Get(const std::string& path) const {
- if (path == kSystemTimezone)
- return timezone_value_.get();
- return NULL;
-}
-
-// The timezone is always trusted.
-CrosSettingsProvider::TrustedStatus
- SystemSettingsProvider::PrepareTrustedValues(const base::Closure& cb) {
- return TRUSTED;
-}
-
-bool SystemSettingsProvider::HandlesSetting(const std::string& path) const {
- return path == kSystemTimezone;
-}
-
-void SystemSettingsProvider::Reload() {
- // TODO(pastarmovj): We can actually cache the timezone here to make returning
- // it faster.
-}
-
-void SystemSettingsProvider::TimezoneChanged(const icu::TimeZone& timezone) {
- // Fires system setting change notification.
- timezone_value_.reset(base::Value::CreateStringValue(
- system::TimezoneSettings::GetTimezoneID(timezone)));
- NotifyObservers(kSystemTimezone);
-}
-
-} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/system_settings_provider.h ('k') | chrome/browser/policy/app_pack_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698