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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 12079097: Introduce PrefRegistrySyncable, simplifying PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head again; base::File changes conflicted. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/download/download_prefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 28d613da34e97786478a3aad50ad72b8e0b95a49..dcfbfd153197eabac72b27c5e048db0d8b9b19f7 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -34,6 +34,7 @@
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/intents/web_intents_util.h"
#include "chrome/browser/platform_util.h"
+#include "chrome/browser/prefs/pref_registry_syncable.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
@@ -507,7 +508,7 @@ void ChromeDownloadManagerDelegate::GetSaveDir(
base::FilePath* download_save_dir,
bool* skip_dir_check) {
Profile* profile = Profile::FromBrowserContext(browser_context);
- PrefServiceSyncable* prefs = profile->GetPrefs();
+ PrefService* prefs = profile->GetPrefs();
// Check whether the preference has the preferred directory for saving file.
// If not, initialize it with default directory.
@@ -515,9 +516,13 @@ void ChromeDownloadManagerDelegate::GetSaveDir(
DCHECK(prefs->FindPreference(prefs::kDownloadDefaultDirectory));
base::FilePath default_save_path = prefs->GetFilePath(
prefs::kDownloadDefaultDirectory);
- prefs->RegisterFilePathPref(prefs::kSaveFileDefaultDirectory,
- default_save_path,
- PrefServiceSyncable::UNSYNCABLE_PREF);
+
+ // TODO(joi): All registration should be done up front.
+ scoped_refptr<PrefRegistrySyncable> registry(
+ static_cast<PrefRegistrySyncable*>(prefs->DeprecatedGetPrefRegistry()));
+ registry->RegisterFilePathPref(prefs::kSaveFileDefaultDirectory,
+ default_save_path,
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
}
// Get the directory from preference.
« no previous file with comments | « chrome/browser/devtools/devtools_window.cc ('k') | chrome/browser/download/download_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698