| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "chrome/browser/prefs/pref_member.h" | 12 #include "chrome/browser/prefs/pref_member.h" |
| 13 | 13 |
| 14 class DownloadManager; | 14 class DownloadManagerInterface; |
| 15 class PrefService; | 15 class PrefService; |
| 16 | 16 |
| 17 // Stores all download-related preferences. | 17 // Stores all download-related preferences. |
| 18 class DownloadPrefs { | 18 class DownloadPrefs { |
| 19 public: | 19 public: |
| 20 explicit DownloadPrefs(PrefService* prefs); | 20 explicit DownloadPrefs(PrefService* prefs); |
| 21 ~DownloadPrefs(); | 21 ~DownloadPrefs(); |
| 22 | 22 |
| 23 static void RegisterUserPrefs(PrefService* prefs); | 23 static void RegisterUserPrefs(PrefService* prefs); |
| 24 | 24 |
| 25 // Returns the DownloadPrefs corresponding to the given DownloadManager. | 25 // Returns the DownloadPrefs corresponding to the given DownloadManager. |
| 26 static DownloadPrefs* FromDownloadManager(DownloadManager* download_manager); | 26 static DownloadPrefs* FromDownloadManager( |
| 27 DownloadManagerInterface* download_manager); |
| 27 | 28 |
| 28 FilePath download_path() const { return *download_path_; } | 29 FilePath download_path() const { return *download_path_; } |
| 29 int save_file_type() const { return *save_file_type_; } | 30 int save_file_type() const { return *save_file_type_; } |
| 30 | 31 |
| 31 // Returns true if the prompt_for_download preference has been set and the | 32 // Returns true if the prompt_for_download preference has been set and the |
| 32 // download location is not managed (which means the user shouldn't be able | 33 // download location is not managed (which means the user shouldn't be able |
| 33 // to choose another download location). | 34 // to choose another download location). |
| 34 bool PromptForDownload() const; | 35 bool PromptForDownload() const; |
| 35 | 36 |
| 36 // Returns true if the download path preference is managed. | 37 // Returns true if the download path preference is managed. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 66 bool operator()(const FilePath::StringType& a, | 67 bool operator()(const FilePath::StringType& a, |
| 67 const FilePath::StringType& b) const; | 68 const FilePath::StringType& b) const; |
| 68 }; | 69 }; |
| 69 typedef std::set<FilePath::StringType, AutoOpenCompareFunctor> AutoOpenSet; | 70 typedef std::set<FilePath::StringType, AutoOpenCompareFunctor> AutoOpenSet; |
| 70 AutoOpenSet auto_open_; | 71 AutoOpenSet auto_open_; |
| 71 | 72 |
| 72 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); | 73 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ | 76 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ |
| OLD | NEW |