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 1178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 1197 &info, |
1198 0, | 1198 0, |
1199 FILE_PATH_LITERAL(std::string()), | 1199 base::FilePath::StringType(), |
1200 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), | 1200 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), |
1201 NULL); | 1201 NULL); |
1202 } | 1202 } |
1203 | 1203 |
1204 void BrowserOptionsHandler::FileSelected(const base::FilePath& path, int index, | 1204 void BrowserOptionsHandler::FileSelected(const base::FilePath& path, int index, |
1205 void* params) { | 1205 void* params) { |
1206 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); | 1206 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); |
1207 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1207 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1208 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); | 1208 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); |
1209 } | 1209 } |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 base::FundamentalValue disabled(profile_pref_registrar_.IsManaged() || | 1506 base::FundamentalValue disabled(profile_pref_registrar_.IsManaged() || |
1507 is_extension_controlled); | 1507 is_extension_controlled); |
1508 base::FundamentalValue extension_controlled(is_extension_controlled); | 1508 base::FundamentalValue extension_controlled(is_extension_controlled); |
1509 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", | 1509 web_ui()->CallJavascriptFunction("BrowserOptions.setupProxySettingsSection", |
1510 disabled, extension_controlled); | 1510 disabled, extension_controlled); |
1511 | 1511 |
1512 #endif // !defined(OS_CHROMEOS) | 1512 #endif // !defined(OS_CHROMEOS) |
1513 } | 1513 } |
1514 | 1514 |
1515 } // namespace options | 1515 } // namespace options |
OLD | NEW |