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 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/prefs/public/pref_member.h" | 11 #include "base/prefs/public/pref_member.h" |
12 | 12 |
13 class PrefServiceSyncable; | 13 class PrefRegistrySyncable; |
| 14 class PrefService; |
14 class Profile; | 15 class Profile; |
15 | 16 |
16 namespace content { | 17 namespace content { |
17 class BrowserContext; | 18 class BrowserContext; |
18 class DownloadManager; | 19 class DownloadManager; |
19 } | 20 } |
20 | 21 |
21 // Stores all download-related preferences. | 22 // Stores all download-related preferences. |
22 class DownloadPrefs { | 23 class DownloadPrefs { |
23 public: | 24 public: |
24 explicit DownloadPrefs(Profile* profile); | 25 explicit DownloadPrefs(Profile* profile); |
25 ~DownloadPrefs(); | 26 ~DownloadPrefs(); |
26 | 27 |
27 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 28 static void RegisterUserPrefs(PrefService* user_prefs, |
| 29 PrefRegistrySyncable* registry); |
28 | 30 |
29 // Returns the DownloadPrefs corresponding to the given DownloadManager | 31 // Returns the DownloadPrefs corresponding to the given DownloadManager |
30 // or BrowserContext. | 32 // or BrowserContext. |
31 static DownloadPrefs* FromDownloadManager( | 33 static DownloadPrefs* FromDownloadManager( |
32 content::DownloadManager* download_manager); | 34 content::DownloadManager* download_manager); |
33 static DownloadPrefs* FromBrowserContext( | 35 static DownloadPrefs* FromBrowserContext( |
34 content::BrowserContext* browser_context); | 36 content::BrowserContext* browser_context); |
35 | 37 |
36 base::FilePath DownloadPath() const; | 38 base::FilePath DownloadPath() const; |
37 int save_file_type() const { return *save_file_type_; } | 39 int save_file_type() const { return *save_file_type_; } |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 const base::FilePath::StringType& b) const; | 77 const base::FilePath::StringType& b) const; |
76 }; | 78 }; |
77 typedef std::set<base::FilePath::StringType, | 79 typedef std::set<base::FilePath::StringType, |
78 AutoOpenCompareFunctor> AutoOpenSet; | 80 AutoOpenCompareFunctor> AutoOpenSet; |
79 AutoOpenSet auto_open_; | 81 AutoOpenSet auto_open_; |
80 | 82 |
81 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); | 83 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); |
82 }; | 84 }; |
83 | 85 |
84 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ | 86 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ |
OLD | NEW |