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

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

Issue 2666093002: Remove base::FundamentalValue (Closed)
Patch Set: Rebase Created 3 years, 9 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/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/download/download_prefs.h" 8 #include "chrome/browser/download/download_prefs.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/chrome_select_file_policy.h" 10 #include "chrome/browser/ui/chrome_select_file_policy.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 SendAutoOpenDownloadsToJavascript(); 62 SendAutoOpenDownloadsToJavascript();
63 } 63 }
64 64
65 void DownloadsHandler::SendAutoOpenDownloadsToJavascript() { 65 void DownloadsHandler::SendAutoOpenDownloadsToJavascript() {
66 content::DownloadManager* manager = 66 content::DownloadManager* manager =
67 content::BrowserContext::GetDownloadManager(profile_); 67 content::BrowserContext::GetDownloadManager(profile_);
68 bool auto_open_downloads = 68 bool auto_open_downloads =
69 manager && DownloadPrefs::FromDownloadManager(manager)->IsAutoOpenUsed(); 69 manager && DownloadPrefs::FromDownloadManager(manager)->IsAutoOpenUsed();
70 CallJavascriptFunction("cr.webUIListenerCallback", 70 CallJavascriptFunction("cr.webUIListenerCallback",
71 base::StringValue("auto-open-downloads-changed"), 71 base::StringValue("auto-open-downloads-changed"),
72 base::FundamentalValue(auto_open_downloads)); 72 base::Value(auto_open_downloads));
73 } 73 }
74 74
75 void DownloadsHandler::HandleResetAutoOpenFileTypes( 75 void DownloadsHandler::HandleResetAutoOpenFileTypes(
76 const base::ListValue* args) { 76 const base::ListValue* args) {
77 content::RecordAction(UserMetricsAction("Options_ResetAutoOpenFiles")); 77 content::RecordAction(UserMetricsAction("Options_ResetAutoOpenFiles"));
78 content::DownloadManager* manager = 78 content::DownloadManager* manager =
79 content::BrowserContext::GetDownloadManager(profile_); 79 content::BrowserContext::GetDownloadManager(profile_);
80 if (manager) 80 if (manager)
81 DownloadPrefs::FromDownloadManager(manager)->ResetAutoOpen(); 81 DownloadPrefs::FromDownloadManager(manager)->ResetAutoOpen();
82 } 82 }
(...skipping 16 matching lines...) Expand all
99 void DownloadsHandler::FileSelected(const base::FilePath& path, 99 void DownloadsHandler::FileSelected(const base::FilePath& path,
100 int index, 100 int index,
101 void* params) { 101 void* params) {
102 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory")); 102 content::RecordAction(UserMetricsAction("Options_SetDownloadDirectory"));
103 PrefService* pref_service = profile_->GetPrefs(); 103 PrefService* pref_service = profile_->GetPrefs();
104 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path); 104 pref_service->SetFilePath(prefs::kDownloadDefaultDirectory, path);
105 pref_service->SetFilePath(prefs::kSaveFileDefaultDirectory, path); 105 pref_service->SetFilePath(prefs::kSaveFileDefaultDirectory, path);
106 } 106 }
107 107
108 } // namespace settings 108 } // namespace settings
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/settings/chromeos/fingerprint_handler.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