| 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 15bf0b1f2804cc1f6c305342bf3b2abef13b180e..2f380633dba71ea407b5a4ecef2a969b97cc421c 100644
|
| --- a/chrome/browser/ui/webui/options2/browser_options_handler2.cc
|
| +++ b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
|
| @@ -961,11 +961,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 =
|
| @@ -1002,6 +1006,10 @@ void BrowserOptionsHandler::SendProfilesInfo() {
|
| }
|
|
|
| void BrowserOptionsHandler::CreateProfile(const ListValue* args) {
|
| + // This handler could have been called in managed mode, for example because
|
| + // the user fiddled with the web inspector. Silently return in this case.
|
| + if (g_browser_process->local_state()->GetBoolean(prefs::kInManagedMode))
|
| + return;
|
| ProfileManager::CreateMultiProfileAsync();
|
| }
|
|
|
|
|