Chromium Code Reviews| Index: chrome/browser/ui/webui/options2/browser_options_handler2.cc |
| diff --git a/chrome/browser/ui/webui/options2/browser_options_handler2.cc b/chrome/browser/ui/webui/options2/browser_options_handler2.cc |
| index cbbfc6bb901f5af20166f335c7f48df0e538817b..1193ca35ae2d187e3fba5b7b9c782502f13e6c3a 100644 |
| --- a/chrome/browser/ui/webui/options2/browser_options_handler2.cc |
| +++ b/chrome/browser/ui/webui/options2/browser_options_handler2.cc |
| @@ -652,11 +652,15 @@ void BrowserOptionsHandler::OnResultChanged(bool default_match_changed) { |
| void BrowserOptionsHandler::SendProfilesInfo() { |
| // Set profile creation text and button if multi-profiles switch is on. |
| - scoped_ptr<Value> visible(Value::CreateBooleanValue(multiprofile_)); |
| + bool profiles_section_visible = multiprofile_ && |
| + !g_browser_process->local_state()->GetBoolean(prefs::kInManagedMode); |
| + |
| + scoped_ptr<Value> visible( |
| + Value::CreateBooleanValue(profiles_section_visible)); |
| web_ui()->CallJavascriptFunction("BrowserOptions.setProfilesSectionVisible", |
| *visible); |
| - if (!multiprofile_) |
| + if (!profiles_section_visible) |
| return; |
| ProfileInfoCache& cache = |
| @@ -693,6 +697,10 @@ void BrowserOptionsHandler::SendProfilesInfo() { |
| } |
| void BrowserOptionsHandler::CreateProfile(const ListValue* args) { |
| + if (g_browser_process->local_state()->GetBoolean(prefs::kInManagedMode)) { |
| + NOTREACHED(); |
| + return; |
|
James Hawkins
2012/03/01 12:42:33
Don't 'handle' NOTREACHEDs by returning.
Bernhard Bauer
2012/03/01 16:08:32
Hm, what do you propose? Silently returning or CHE
James Hawkins
2012/03/01 19:51:36
If it really should not fail, use NOTREACHED and d
Bernhard Bauer
2012/03/01 23:02:16
It can happen, in the case where a malicious user
|
| + } |
| ProfileManager::CreateMultiProfileAsync(); |
| } |