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 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 const ListValue* args) { | 1187 const ListValue* args) { |
1188 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1188 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1189 select_folder_dialog_ = ui::SelectFileDialog::Create( | 1189 select_folder_dialog_ = ui::SelectFileDialog::Create( |
1190 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); | 1190 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); |
1191 ui::SelectFileDialog::FileTypeInfo info; | 1191 ui::SelectFileDialog::FileTypeInfo info; |
1192 info.support_drive = true; | 1192 info.support_drive = true; |
1193 select_folder_dialog_->SelectFile( | 1193 select_folder_dialog_->SelectFile( |
1194 ui::SelectFileDialog::SELECT_FOLDER, | 1194 ui::SelectFileDialog::SELECT_FOLDER, |
1195 l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), | 1195 l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), |
1196 pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), | 1196 pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), |
1197 &info, 0, FILE_PATH_LITERAL(""), | 1197 &info, |
1198 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); | 1198 0, |
| 1199 base::FilePath::StringType(), |
| 1200 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), |
| 1201 NULL); |
1199 } | 1202 } |
1200 | 1203 |
1201 void BrowserOptionsHandler::FileSelected(const base::FilePath& path, int index, | 1204 void BrowserOptionsHandler::FileSelected(const base::FilePath& path, int index, |
1202 void* params) { | 1205 void* params) { |
1203 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); | 1206 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); |
1204 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1207 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1205 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); | 1208 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); |
1206 } | 1209 } |
1207 | 1210 |
1208 void BrowserOptionsHandler::OnCloudPrintSetupClosed() { | 1211 void BrowserOptionsHandler::OnCloudPrintSetupClosed() { |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 base::FundamentalValue disabled(profile_pref_registrar_.IsManaged() || | 1506 base::FundamentalValue disabled(profile_pref_registrar_.IsManaged() || |
1504 is_extension_controlled); | 1507 is_extension_controlled); |
1505 base::FundamentalValue extension_controlled(is_extension_controlled); | 1508 base::FundamentalValue extension_controlled(is_extension_controlled); |
1506 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", | 1509 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", |
1507 disabled, extension_controlled); | 1510 disabled, extension_controlled); |
1508 | 1511 |
1509 #endif // !defined(OS_CHROMEOS) | 1512 #endif // !defined(OS_CHROMEOS) |
1510 } | 1513 } |
1511 | 1514 |
1512 } // namespace options | 1515 } // namespace options |
OLD | NEW |