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/options/browser_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/browser_options_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 | 959 |
960 void BrowserOptionsHandler::CreateProfile(const ListValue* args) { | 960 void BrowserOptionsHandler::CreateProfile(const ListValue* args) { |
961 // This handler could have been called in managed mode, for example because | 961 // This handler could have been called in managed mode, for example because |
962 // the user fiddled with the web inspector. Silently return in this case. | 962 // the user fiddled with the web inspector. Silently return in this case. |
963 if (!ProfileManager::IsMultipleProfilesEnabled()) | 963 if (!ProfileManager::IsMultipleProfilesEnabled()) |
964 return; | 964 return; |
965 string16 name, icon; | 965 string16 name, icon; |
966 bool create_box_checked; | 966 bool create_box_checked; |
967 | 967 |
968 Browser* browser = | 968 Browser* browser = |
969 browser::FindBrowserWithWebContents(web_ui()->GetWebContents()); | 969 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()); |
970 chrome::HostDesktopType desktop_type = chrome::HOST_DESKTOP_TYPE_NATIVE; | 970 chrome::HostDesktopType desktop_type = chrome::HOST_DESKTOP_TYPE_NATIVE; |
971 if (browser) | 971 if (browser) |
972 desktop_type = browser->host_desktop_type(); | 972 desktop_type = browser->host_desktop_type(); |
973 | 973 |
974 if (args->GetString(0, &name) && args->GetString(1, &icon)) { | 974 if (args->GetString(0, &name) && args->GetString(1, &icon)) { |
975 if (args->GetBoolean(2, &create_box_checked) && create_box_checked) { | 975 if (args->GetBoolean(2, &create_box_checked) && create_box_checked) { |
976 ProfileManager::CreateMultiProfileAsync( | 976 ProfileManager::CreateMultiProfileAsync( |
977 name, icon, base::Bind(&CreateDesktopShortcutForProfile), desktop_type); | 977 name, icon, base::Bind(&CreateDesktopShortcutForProfile), desktop_type); |
978 } else { | 978 } else { |
979 ProfileManager::CreateMultiProfileAsync( | 979 ProfileManager::CreateMultiProfileAsync( |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); | 1420 l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
1421 } | 1421 } |
1422 StringValue label(label_str); | 1422 StringValue label(label_str); |
1423 | 1423 |
1424 web_ui()->CallJavascriptFunction( | 1424 web_ui()->CallJavascriptFunction( |
1425 "BrowserOptions.setupProxySettingsSection", disabled, label); | 1425 "BrowserOptions.setupProxySettingsSection", disabled, label); |
1426 #endif // !defined(OS_CHROMEOS) | 1426 #endif // !defined(OS_CHROMEOS) |
1427 } | 1427 } |
1428 | 1428 |
1429 } // namespace options | 1429 } // namespace options |
OLD | NEW |