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

Side by Side Diff: chrome/browser/download/download_prefs.h

Issue 8817005: Revert 113007 - DownloadManager intereface refactoring to allow cleaner DownloadItem unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Deleted: svn:eol-style
- LF
OLDNEW
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 DownloadManager;
15 class PrefService; 15 class PrefService;
16 16
17 namespace content {
18 class BrowserContext;
19 }
20
21 // Stores all download-related preferences. 17 // Stores all download-related preferences.
22 class DownloadPrefs { 18 class DownloadPrefs {
23 public: 19 public:
24 explicit DownloadPrefs(PrefService* prefs); 20 explicit DownloadPrefs(PrefService* prefs);
25 ~DownloadPrefs(); 21 ~DownloadPrefs();
26 22
27 static void RegisterUserPrefs(PrefService* prefs); 23 static void RegisterUserPrefs(PrefService* prefs);
28 24
29 // Returns the DownloadPrefs corresponding to the given DownloadManager 25 // Returns the DownloadPrefs corresponding to the given DownloadManager.
30 // or BrowserContext.
31 static DownloadPrefs* FromDownloadManager(DownloadManager* download_manager); 26 static DownloadPrefs* FromDownloadManager(DownloadManager* download_manager);
32 static DownloadPrefs* FromBrowserContext(
33 content::BrowserContext* browser_context);
34 27
35 FilePath download_path() const { return *download_path_; } 28 FilePath download_path() const { return *download_path_; }
36 int save_file_type() const { return *save_file_type_; } 29 int save_file_type() const { return *save_file_type_; }
37 30
38 // Returns true if the prompt_for_download preference has been set and the 31 // Returns true if the prompt_for_download preference has been set and the
39 // download location is not managed (which means the user shouldn't be able 32 // download location is not managed (which means the user shouldn't be able
40 // to choose another download location). 33 // to choose another download location).
41 bool PromptForDownload() const; 34 bool PromptForDownload() const;
42 35
43 // Returns true if the download path preference is managed. 36 // Returns true if the download path preference is managed.
(...skipping 29 matching lines...) Expand all
73 bool operator()(const FilePath::StringType& a, 66 bool operator()(const FilePath::StringType& a,
74 const FilePath::StringType& b) const; 67 const FilePath::StringType& b) const;
75 }; 68 };
76 typedef std::set<FilePath::StringType, AutoOpenCompareFunctor> AutoOpenSet; 69 typedef std::set<FilePath::StringType, AutoOpenCompareFunctor> AutoOpenSet;
77 AutoOpenSet auto_open_; 70 AutoOpenSet auto_open_;
78 71
79 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); 72 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs);
80 }; 73 };
81 74
82 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ 75 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_
OLDNEW
« no previous file with comments | « chrome/browser/download/download_item_unittest.cc ('k') | chrome/browser/download/download_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698