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" |
(...skipping 28 matching lines...) Expand all Loading... |
39 #include "chrome/browser/search_engines/template_url_service.h" | 39 #include "chrome/browser/search_engines/template_url_service.h" |
40 #include "chrome/browser/search_engines/template_url_service_factory.h" | 40 #include "chrome/browser/search_engines/template_url_service_factory.h" |
41 #include "chrome/browser/service/service_process_control.h" | 41 #include "chrome/browser/service/service_process_control.h" |
42 #include "chrome/browser/signin/signin_manager.h" | 42 #include "chrome/browser/signin/signin_manager.h" |
43 #include "chrome/browser/signin/signin_manager_factory.h" | 43 #include "chrome/browser/signin/signin_manager_factory.h" |
44 #include "chrome/browser/sync/profile_sync_service.h" | 44 #include "chrome/browser/sync/profile_sync_service.h" |
45 #include "chrome/browser/sync/profile_sync_service_factory.h" | 45 #include "chrome/browser/sync/profile_sync_service_factory.h" |
46 #include "chrome/browser/sync/sync_ui_util.h" | 46 #include "chrome/browser/sync/sync_ui_util.h" |
47 #include "chrome/browser/themes/theme_service.h" | 47 #include "chrome/browser/themes/theme_service.h" |
48 #include "chrome/browser/themes/theme_service_factory.h" | 48 #include "chrome/browser/themes/theme_service_factory.h" |
| 49 #include "chrome/browser/ui/chrome_select_file_policy.h" |
49 #include "chrome/browser/ui/options/options_util.h" | 50 #include "chrome/browser/ui/options/options_util.h" |
50 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 51 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
51 #include "chrome/browser/ui/webui/favicon_source.h" | 52 #include "chrome/browser/ui/webui/favicon_source.h" |
52 #include "chrome/browser/ui/webui/web_ui_util.h" | 53 #include "chrome/browser/ui/webui/web_ui_util.h" |
53 #include "chrome/common/chrome_constants.h" | 54 #include "chrome/common/chrome_constants.h" |
54 #include "chrome/common/chrome_notification_types.h" | 55 #include "chrome/common/chrome_notification_types.h" |
55 #include "chrome/common/chrome_paths.h" | 56 #include "chrome/common/chrome_paths.h" |
56 #include "chrome/common/chrome_switches.h" | 57 #include "chrome/common/chrome_switches.h" |
57 #include "chrome/common/net/gaia/google_service_auth_error.h" | 58 #include "chrome/common/net/gaia/google_service_auth_error.h" |
58 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" |
(...skipping 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1027 "autoLoginVisible", | 1028 "autoLoginVisible", |
1028 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin) && | 1029 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin) && |
1029 service->IsSyncEnabledAndLoggedIn() && service->IsSyncTokenAvailable()); | 1030 service->IsSyncEnabledAndLoggedIn() && service->IsSyncTokenAvailable()); |
1030 | 1031 |
1031 return sync_status.Pass(); | 1032 return sync_status.Pass(); |
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( |
| 1039 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); |
1038 select_folder_dialog_->SelectFile( | 1040 select_folder_dialog_->SelectFile( |
1039 SelectFileDialog::SELECT_FOLDER, | 1041 SelectFileDialog::SELECT_FOLDER, |
1040 l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), | 1042 l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), |
1041 pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), | 1043 pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), |
1042 NULL, 0, FILE_PATH_LITERAL(""), web_ui()->GetWebContents(), | 1044 NULL, 0, FILE_PATH_LITERAL(""), |
1043 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); | 1045 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); |
1044 } | 1046 } |
1045 | 1047 |
1046 void BrowserOptionsHandler::FileSelected(const FilePath& path, int index, | 1048 void BrowserOptionsHandler::FileSelected(const FilePath& path, int index, |
1047 void* params) { | 1049 void* params) { |
1048 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); | 1050 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); |
1049 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1051 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
1050 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); | 1052 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); |
1051 } | 1053 } |
1052 | 1054 |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 } | 1422 } |
1421 | 1423 |
1422 void BrowserOptionsHandler::SetupSSLConfigSettings() { | 1424 void BrowserOptionsHandler::SetupSSLConfigSettings() { |
1423 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); | 1425 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); |
1424 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); | 1426 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); |
1425 web_ui()->CallJavascriptFunction( | 1427 web_ui()->CallJavascriptFunction( |
1426 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); | 1428 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); |
1427 } | 1429 } |
1428 | 1430 |
1429 } // namespace options2 | 1431 } // namespace options2 |
OLD | NEW |