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

Side by Side Diff: chrome/browser/prefs/session_startup_pref.cc

Issue 2664753002: Remove base::StringValue (Closed)
Patch Set: Rebase Created 3 years, 9 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 (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/prefs/session_startup_pref.h" 5 #include "chrome/browser/prefs/session_startup_pref.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 if (!SessionStartupPref::URLsAreManaged(prefs)) { 83 if (!SessionStartupPref::URLsAreManaged(prefs)) {
84 // Always save the URLs, that way the UI can remain consistent even if the 84 // Always save the URLs, that way the UI can remain consistent even if the
85 // user changes the startup type pref. 85 // user changes the startup type pref.
86 // Ownership of the ListValue retains with the pref service. 86 // Ownership of the ListValue retains with the pref service.
87 ListPrefUpdate update(prefs, prefs::kURLsToRestoreOnStartup); 87 ListPrefUpdate update(prefs, prefs::kURLsToRestoreOnStartup);
88 base::ListValue* url_pref_list = update.Get(); 88 base::ListValue* url_pref_list = update.Get();
89 DCHECK(url_pref_list); 89 DCHECK(url_pref_list);
90 url_pref_list->Clear(); 90 url_pref_list->Clear();
91 for (size_t i = 0; i < pref.urls.size(); ++i) { 91 for (size_t i = 0; i < pref.urls.size(); ++i) {
92 url_pref_list->Set(static_cast<int>(i), 92 url_pref_list->Set(static_cast<int>(i),
93 new base::StringValue(pref.urls[i].spec())); 93 new base::Value(pref.urls[i].spec()));
94 } 94 }
95 } 95 }
96 } 96 }
97 97
98 // static 98 // static
99 SessionStartupPref SessionStartupPref::GetStartupPref(Profile* profile) { 99 SessionStartupPref SessionStartupPref::GetStartupPref(Profile* profile) {
100 DCHECK(profile); 100 DCHECK(profile);
101 return GetStartupPref(profile->GetPrefs()); 101 return GetStartupPref(profile->GetPrefs());
102 } 102 }
103 103
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 default: return SessionStartupPref::DEFAULT; 152 default: return SessionStartupPref::DEFAULT;
153 } 153 }
154 } 154 }
155 155
156 SessionStartupPref::SessionStartupPref(Type type) : type(type) {} 156 SessionStartupPref::SessionStartupPref(Type type) : type(type) {}
157 157
158 SessionStartupPref::SessionStartupPref(const SessionStartupPref& other) = 158 SessionStartupPref::SessionStartupPref(const SessionStartupPref& other) =
159 default; 159 default;
160 160
161 SessionStartupPref::~SessionStartupPref() {} 161 SessionStartupPref::~SessionStartupPref() {}
OLDNEW
« no previous file with comments | « chrome/browser/prefs/proxy_policy_unittest.cc ('k') | chrome/browser/prefs/session_startup_pref_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698