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

Side by Side Diff: chrome/browser/pref_service_flags_storage.cc

Issue 104493005: Update some uses of Value in chrome/browser to use the base:: namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/pref_service_flags_storage.h" 5 #include "chrome/browser/pref_service_flags_storage.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/prefs/scoped_user_pref_update.h" 8 #include "base/prefs/scoped_user_pref_update.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
11 11
12 namespace about_flags { 12 namespace about_flags {
13 13
14 PrefServiceFlagsStorage::PrefServiceFlagsStorage( 14 PrefServiceFlagsStorage::PrefServiceFlagsStorage(
15 PrefService *prefs) : prefs_(prefs) {} 15 PrefService *prefs) : prefs_(prefs) {}
16 16
17 PrefServiceFlagsStorage::~PrefServiceFlagsStorage() {} 17 PrefServiceFlagsStorage::~PrefServiceFlagsStorage() {}
18 18
19 std::set<std::string> PrefServiceFlagsStorage::GetFlags() { 19 std::set<std::string> PrefServiceFlagsStorage::GetFlags() {
20 const ListValue* enabled_experiments = prefs_->GetList( 20 const base::ListValue* enabled_experiments = prefs_->GetList(
21 prefs::kEnabledLabsExperiments); 21 prefs::kEnabledLabsExperiments);
22 std::set<std::string> flags; 22 std::set<std::string> flags;
23 for (ListValue::const_iterator it = enabled_experiments->begin(); 23 for (base::ListValue::const_iterator it = enabled_experiments->begin();
24 it != enabled_experiments->end(); 24 it != enabled_experiments->end();
25 ++it) { 25 ++it) {
26 std::string experiment_name; 26 std::string experiment_name;
27 if (!(*it)->GetAsString(&experiment_name)) { 27 if (!(*it)->GetAsString(&experiment_name)) {
28 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments; 28 LOG(WARNING) << "Invalid entry in " << prefs::kEnabledLabsExperiments;
29 continue; 29 continue;
30 } 30 }
31 flags.insert(experiment_name); 31 flags.insert(experiment_name);
32 } 32 }
33 return flags; 33 return flags;
34 } 34 }
35 35
36 bool PrefServiceFlagsStorage::SetFlags(const std::set<std::string>& flags) { 36 bool PrefServiceFlagsStorage::SetFlags(const std::set<std::string>& flags) {
37 ListPrefUpdate update(prefs_, prefs::kEnabledLabsExperiments); 37 ListPrefUpdate update(prefs_, prefs::kEnabledLabsExperiments);
38 ListValue* experiments_list = update.Get(); 38 base::ListValue* experiments_list = update.Get();
39 39
40 experiments_list->Clear(); 40 experiments_list->Clear();
41 for (std::set<std::string>::const_iterator it = flags.begin(); 41 for (std::set<std::string>::const_iterator it = flags.begin();
42 it != flags.end(); ++it) { 42 it != flags.end(); ++it) {
43 experiments_list->Append(new StringValue(*it)); 43 experiments_list->Append(new base::StringValue(*it));
44 } 44 }
45 45
46 return true; 46 return true;
47 } 47 }
48 48
49 } // namespace about_flags 49 } // namespace about_flags
OLDNEW
« no previous file with comments | « chrome/browser/policy/url_blacklist_policy_handler.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698