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