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

Side by Side Diff: chrome/browser/ui/webui/flags_ui.cc

Issue 12728008: Revert 186837 "Move pref backing up flags from local state to de..." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 | Annotate | Revision Log
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/ui/webui/flags_ui.h" 5 #include "chrome/browser/ui/webui/flags_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 void FlagsUI::FinishInitialization( 213 void FlagsUI::FinishInitialization(
214 Profile* profile, 214 Profile* profile,
215 chromeos::DeviceSettingsService::OwnershipStatus status, 215 chromeos::DeviceSettingsService::OwnershipStatus status,
216 bool current_user_is_owner) { 216 bool current_user_is_owner) {
217 // On Chrome OS the owner can set system wide flags and other users can only 217 // On Chrome OS the owner can set system wide flags and other users can only
218 // set flags for their own session. 218 // set flags for their own session.
219 if (!current_user_is_owner) { 219 if (!current_user_is_owner) {
220 web_ui()->AddMessageHandler(new FlagsDOMHandler(profile->GetPrefs())); 220 web_ui()->AddMessageHandler(new FlagsDOMHandler(profile->GetPrefs()));
221 } else { 221 } else {
222 web_ui()->AddMessageHandler(new FlagsDOMHandler(NULL)); 222 web_ui()->AddMessageHandler(
223 new FlagsDOMHandler(g_browser_process->local_state()));
223 // If the owner managed to set the flags pref on his own profile clear it 224 // If the owner managed to set the flags pref on his own profile clear it
224 // because it will never be accessible anymore. 225 // because it will never be accessible anymore.
225 if (profile->GetPrefs()->HasPrefPath(prefs::kEnabledLabsExperiments)) 226 if (profile->GetPrefs()->HasPrefPath(prefs::kEnabledLabsExperiments))
226 profile->GetPrefs()->ClearPref(prefs::kEnabledLabsExperiments); 227 profile->GetPrefs()->ClearPref(prefs::kEnabledLabsExperiments);
227 } 228 }
228 229
229 // Set up the about:flags source. 230 // Set up the about:flags source.
230 content::WebUIDataSource::Add(profile, CreateFlagsUIHTMLSource()); 231 content::WebUIDataSource::Add(profile, CreateFlagsUIHTMLSource());
231 } 232 }
232 #endif 233 #endif
OLDNEW
« no previous file with comments | « chrome/browser/policy/proto/chrome_device_policy.proto ('k') | chrome/test/data/policy/policy_test_cases.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698