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 Profile; | 14 class Profile; |
14 | 15 |
15 namespace content { | 16 namespace content { |
16 class BrowserContext; | 17 class BrowserContext; |
17 class DownloadManager; | 18 class DownloadManager; |
18 } | 19 } |
19 | 20 |
20 // Stores all download-related preferences. | 21 // Stores all download-related preferences. |
21 class DownloadPrefs { | 22 class DownloadPrefs { |
22 public: | 23 public: |
23 explicit DownloadPrefs(Profile* profile); | 24 explicit DownloadPrefs(Profile* profile); |
24 ~DownloadPrefs(); | 25 ~DownloadPrefs(); |
25 | 26 |
26 static void RegisterUserPrefs(PrefServiceBase* prefs); | 27 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
27 | 28 |
28 // Returns the DownloadPrefs corresponding to the given DownloadManager | 29 // Returns the DownloadPrefs corresponding to the given DownloadManager |
29 // or BrowserContext. | 30 // or BrowserContext. |
30 static DownloadPrefs* FromDownloadManager( | 31 static DownloadPrefs* FromDownloadManager( |
31 content::DownloadManager* download_manager); | 32 content::DownloadManager* download_manager); |
32 static DownloadPrefs* FromBrowserContext( | 33 static DownloadPrefs* FromBrowserContext( |
33 content::BrowserContext* browser_context); | 34 content::BrowserContext* browser_context); |
34 | 35 |
35 FilePath DownloadPath() const; | 36 FilePath DownloadPath() const; |
36 int save_file_type() const { return *save_file_type_; } | 37 int save_file_type() const { return *save_file_type_; } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 bool operator()(const FilePath::StringType& a, | 74 bool operator()(const FilePath::StringType& a, |
74 const FilePath::StringType& b) const; | 75 const FilePath::StringType& b) const; |
75 }; | 76 }; |
76 typedef std::set<FilePath::StringType, AutoOpenCompareFunctor> AutoOpenSet; | 77 typedef std::set<FilePath::StringType, AutoOpenCompareFunctor> AutoOpenSet; |
77 AutoOpenSet auto_open_; | 78 AutoOpenSet auto_open_; |
78 | 79 |
79 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); | 80 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); |
80 }; | 81 }; |
81 | 82 |
82 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ | 83 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ |
OLD | NEW |