| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/settings/downloads_handler.h" | 5 #include "chrome/browser/ui/webui/settings/downloads_handler.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/prefs/scoped_user_pref_update.h" | 8 #include "base/prefs/scoped_user_pref_update.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/download/download_prefs.h" | 10 #include "chrome/browser/download/download_prefs.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/ui/chrome_select_file_policy.h" | 12 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
| 14 #include "chrome/grit/chromium_strings.h" | 14 #include "chrome/grit/chromium_strings.h" |
| 15 #include "chrome/grit/generated_resources.h" | 15 #include "chrome/grit/settings_strings.h" |
| 16 #include "content/public/browser/user_metrics.h" | 16 #include "content/public/browser/user_metrics.h" |
| 17 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 18 #include "content/public/browser/web_ui.h" | 18 #include "content/public/browser/web_ui.h" |
| 19 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 20 | 20 |
| 21 using base::UserMetricsAction; | 21 using base::UserMetricsAction; |
| 22 | 22 |
| 23 namespace settings { | 23 namespace settings { |
| 24 | 24 |
| 25 DownloadsHandler::DownloadsHandler() { | 25 DownloadsHandler::DownloadsHandler() { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 void DownloadsHandler::FileSelected(const base::FilePath& path, | 57 void DownloadsHandler::FileSelected(const base::FilePath& path, |
| 58 int index, | 58 int index, |
| 59 void* params) { | 59 void* params) { |
| 60 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); | 60 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); |
| 61 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); | 61 PrefService* pref_service = Profile::FromWebUI(web_ui())->GetPrefs(); |
| 62 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); | 62 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); |
| 63 pref_service->SetFilePath(prefs::kSaveFileDefaultDirectory, path); | 63 pref_service->SetFilePath(prefs::kSaveFileDefaultDirectory, path); |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace settings | 66 } // namespace settings |
| OLD | NEW |