Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: chrome/browser/ui/webui/settings/downloads_handler.cc

Issue 1658793002: Update chrome for new prefs location. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
8 #include "base/prefs/scoped_user_pref_update.h"
9 #include "base/values.h" 7 #include "base/values.h"
10 #include "chrome/browser/download/download_prefs.h" 8 #include "chrome/browser/download/download_prefs.h"
11 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/chrome_select_file_policy.h" 10 #include "chrome/browser/ui/chrome_select_file_policy.h"
13 #include "chrome/common/pref_names.h" 11 #include "chrome/common/pref_names.h"
14 #include "chrome/grit/chromium_strings.h" 12 #include "chrome/grit/chromium_strings.h"
15 #include "chrome/grit/settings_strings.h" 13 #include "chrome/grit/settings_strings.h"
14 #include "components/prefs/pref_service.h"
15 #include "components/prefs/scoped_user_pref_update.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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/set_as_default_browser_ui.cc ('k') | chrome/browser/ui/webui/settings/font_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698