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

Side by Side Diff: chrome/browser/extensions/api/settings_private/settings_private_delegate.cc

Issue 1287913005: Refactor prefs.js for MD-Settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add return after switch for non-clang Created 5 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/api/settings_private/settings_private_delega te.h" 5 #include "chrome/browser/extensions/api/settings_private/settings_private_delega te.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chromeos/settings/cros_settings.h" 10 #include "chrome/browser/chromeos/settings/cros_settings.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 const TypedPrefMap& keys = prefs_util_->GetWhitelistedKeys(); 42 const TypedPrefMap& keys = prefs_util_->GetWhitelistedKeys();
43 for (const auto& it : keys) { 43 for (const auto& it : keys) {
44 scoped_ptr<base::Value> pref = GetPref(it.first); 44 scoped_ptr<base::Value> pref = GetPref(it.first);
45 if (!pref->IsType(base::Value::TYPE_NULL)) 45 if (!pref->IsType(base::Value::TYPE_NULL))
46 prefs->Append(pref.release()); 46 prefs->Append(pref.release());
47 } 47 }
48 48
49 return prefs.Pass(); 49 return prefs.Pass();
50 } 50 }
51 51
52 bool SettingsPrivateDelegate::SetPref(const std::string& pref_name, 52 PrefsUtil::SetPrefResult SettingsPrivateDelegate::SetPref(
53 const base::Value* value) { 53 const std::string& pref_name, const base::Value* value) {
54 return prefs_util_->SetPref(pref_name, value); 54 return prefs_util_->SetPref(pref_name, value);
55 } 55 }
56 56
57 } // namespace extensions 57 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698