| 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 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 service->IsSyncEnabledAndLoggedIn() && service->IsSyncTokenAvailable()); | 1068 service->IsSyncEnabledAndLoggedIn() && service->IsSyncTokenAvailable()); |
| 1069 | 1069 |
| 1070 return sync_status.Pass(); | 1070 return sync_status.Pass(); |
| 1071 } | 1071 } |
| 1072 | 1072 |
| 1073 void BrowserOptionsHandler::HandleSelectDownloadLocation( | 1073 void BrowserOptionsHandler::HandleSelectDownloadLocation( |
| 1074 const ListValue* args) { | 1074 const ListValue* args) { |
| 1075 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1075 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1076 select_folder_dialog_ = ui::SelectFileDialog::Create( | 1076 select_folder_dialog_ = ui::SelectFileDialog::Create( |
| 1077 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); | 1077 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); |
| 1078 ui::SelectFileDialog::FileTypeInfo info; |
| 1079 info.support_gdata = true; |
| 1078 select_folder_dialog_->SelectFile( | 1080 select_folder_dialog_->SelectFile( |
| 1079 ui::SelectFileDialog::SELECT_FOLDER, | 1081 ui::SelectFileDialog::SELECT_FOLDER, |
| 1080 l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), | 1082 l10n_util::GetStringUTF16(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE), |
| 1081 pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), | 1083 pref_service->GetFilePath(prefs::kDownloadDefaultDirectory), |
| 1082 NULL, 0, FILE_PATH_LITERAL(""), | 1084 &info, 0, FILE_PATH_LITERAL(""), |
| 1083 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); | 1085 web_ui()->GetWebContents()->GetView()->GetTopLevelNativeWindow(), NULL); |
| 1084 } | 1086 } |
| 1085 | 1087 |
| 1086 void BrowserOptionsHandler::FileSelected(const FilePath& path, int index, | 1088 void BrowserOptionsHandler::FileSelected(const FilePath& path, int index, |
| 1087 void* params) { | 1089 void* params) { |
| 1088 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); | 1090 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); |
| 1089 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 1091 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 1090 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); | 1092 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); |
| 1091 } | 1093 } |
| 1092 | 1094 |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1465 } | 1467 } |
| 1466 | 1468 |
| 1467 void BrowserOptionsHandler::SetupSSLConfigSettings() { | 1469 void BrowserOptionsHandler::SetupSSLConfigSettings() { |
| 1468 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); | 1470 base::FundamentalValue checked(rev_checking_enabled_.GetValue()); |
| 1469 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); | 1471 base::FundamentalValue disabled(rev_checking_enabled_.IsManaged()); |
| 1470 web_ui()->CallJavascriptFunction( | 1472 web_ui()->CallJavascriptFunction( |
| 1471 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); | 1473 "BrowserOptions.setCheckRevocationCheckboxState", checked, disabled); |
| 1472 } | 1474 } |
| 1473 | 1475 |
| 1474 } // namespace options | 1476 } // namespace options |
| OLD | NEW |