Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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( | 222 web_ui()->AddMessageHandler(new FlagsDOMHandler(NULL)); |
|
Joao da Silva
2013/03/05 17:46:30
Tracking that |prefs| variable around about_flags.
pastarmovj
2013/03/06 17:28:31
Ack. I'd rather keep this work for a later CL.
| |
| 223 new FlagsDOMHandler(g_browser_process->local_state())); | |
| 224 // If the owner managed to set the flags pref on his own profile clear it | 223 // If the owner managed to set the flags pref on his own profile clear it |
| 225 // because it will never be accessible anymore. | 224 // because it will never be accessible anymore. |
| 226 if (profile->GetPrefs()->HasPrefPath(prefs::kEnabledLabsExperiments)) | 225 if (profile->GetPrefs()->HasPrefPath(prefs::kEnabledLabsExperiments)) |
| 227 profile->GetPrefs()->ClearPref(prefs::kEnabledLabsExperiments); | 226 profile->GetPrefs()->ClearPref(prefs::kEnabledLabsExperiments); |
| 228 } | 227 } |
| 229 | 228 |
| 230 // Set up the about:flags source. | 229 // Set up the about:flags source. |
| 231 content::WebUIDataSource::Add(profile, CreateFlagsUIHTMLSource()); | 230 content::WebUIDataSource::Add(profile, CreateFlagsUIHTMLSource()); |
| 232 } | 231 } |
| 233 #endif | 232 #endif |
| OLD | NEW |