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/options2/browser_options_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/browser_options_handler2.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" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/bind_helpers.h" | 12 #include "base/bind_helpers.h" |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
17 #include "base/string_number_conversions.h" | 17 #include "base/string_number_conversions.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "base/value_conversions.h" | 19 #include "base/value_conversions.h" |
20 #include "base/values.h" | 20 #include "base/values.h" |
21 #include "chrome/browser/auto_launch_trial.h" | 21 #include "chrome/browser/auto_launch_trial.h" |
22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
23 #include "chrome/browser/chrome_page_zoom.h" | 23 #include "chrome/browser/chrome_page_zoom.h" |
| 24 #include "chrome/browser/chrome_select_file_policy.h" |
24 #include "chrome/browser/custom_home_pages_table_model.h" | 25 #include "chrome/browser/custom_home_pages_table_model.h" |
25 #include "chrome/browser/download/download_prefs.h" | 26 #include "chrome/browser/download/download_prefs.h" |
26 #include "chrome/browser/instant/instant_controller.h" | 27 #include "chrome/browser/instant/instant_controller.h" |
27 #include "chrome/browser/net/url_fixer_upper.h" | 28 #include "chrome/browser/net/url_fixer_upper.h" |
28 #include "chrome/browser/prefs/pref_service.h" | 29 #include "chrome/browser/prefs/pref_service.h" |
29 #include "chrome/browser/prefs/session_startup_pref.h" | 30 #include "chrome/browser/prefs/session_startup_pref.h" |
30 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 31 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
31 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" | 32 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" |
32 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" | 33 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" |
33 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" | 34 #include "chrome/browser/printing/cloud_print/cloud_print_url.h" |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 } | 1033 } |
1033 | 1034 |
1034 void BrowserOptionsHandler::HandleSelectDownloadLocation( | 1035 void BrowserOptionsHandler::HandleSelectDownloadLocation( |
1035 const ListValue* args) { | 1036 const ListValue* args) { |
1036 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1037 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1037 select_folder_dialog_ = SelectFileDialog::Create(this); | 1038 select_folder_dialog_ = SelectFileDialog::Create(this); |
1038 select_folder_dialog_->SelectFile( | 1039 select_folder_dialog_->SelectFile( |
1039 SelectFileDialog::SELECT_FOLDER, | 1040 SelectFileDialog::SELECT_FOLDER, |
1040 l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), | 1041 l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), |
1041 pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), | 1042 pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), |
1042 NULL, 0, FILE_PATH_LITERAL(""), web_ui()->GetWebContents(), | 1043 NULL, 0, FILE_PATH_LITERAL(""), |
| 1044 ChromeSelectFilePolicy::DisplayInfobarCallback( |
| 1045 web_ui()->GetWebContents()), |
1043 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); | 1046 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); |
1044 } | 1047 } |
1045 | 1048 |
1046 void BrowserOptionsHandler::FileSelected(const FilePath& path, int index, | 1049 void BrowserOptionsHandler::FileSelected(const FilePath& path, int index, |
1047 void* params) { | 1050 void* params) { |
1048 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); | 1051 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); |
1049 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1052 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1050 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); | 1053 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); |
1051 } | 1054 } |
1052 | 1055 |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 } | 1423 } |
1421 | 1424 |
1422 void BrowserOptionsHandler::SetupSSLConfigSettings() { | 1425 void BrowserOptionsHandler::SetupSSLConfigSettings() { |
1423 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); | 1426 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); |
1424 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); | 1427 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); |
1425 web_ui()->CallJavascriptFunction( | 1428 web_ui()->CallJavascriptFunction( |
1426 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); | 1429 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); |
1427 } | 1430 } |
1428 | 1431 |
1429 } // namespace options2 | 1432 } // namespace options2 |
OLD | NEW |