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

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

Issue 12662032: Merge SavePackageFilePicker{,ChromeOS} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r198452 Created 7 years, 7 months 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
OLDNEW
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"
(...skipping 20 matching lines...) Expand all
31 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); 31 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry);
32 32
33 // Returns the DownloadPrefs corresponding to the given DownloadManager 33 // Returns the DownloadPrefs corresponding to the given DownloadManager
34 // or BrowserContext. 34 // or BrowserContext.
35 static DownloadPrefs* FromDownloadManager( 35 static DownloadPrefs* FromDownloadManager(
36 content::DownloadManager* download_manager); 36 content::DownloadManager* download_manager);
37 static DownloadPrefs* FromBrowserContext( 37 static DownloadPrefs* FromBrowserContext(
38 content::BrowserContext* browser_context); 38 content::BrowserContext* browser_context);
39 39
40 base::FilePath DownloadPath() const; 40 base::FilePath DownloadPath() const;
41 void SetDownloadPath(const base::FilePath& path);
42 base::FilePath SaveFilePath() const;
43 void SetSaveFilePath(const base::FilePath& path);
41 int save_file_type() const { return *save_file_type_; } 44 int save_file_type() const { return *save_file_type_; }
45 void SetSaveFileType(int type);
42 46
43 // Returns true if the prompt_for_download preference has been set and the 47 // Returns true if the prompt_for_download preference has been set and the
44 // download location is not managed (which means the user shouldn't be able 48 // download location is not managed (which means the user shouldn't be able
45 // to choose another download location). 49 // to choose another download location).
46 bool PromptForDownload() const; 50 bool PromptForDownload() const;
47 51
48 // Returns true if the download path preference is managed. 52 // Returns true if the download path preference is managed.
49 bool IsDownloadPathManaged() const; 53 bool IsDownloadPathManaged() const;
50 54
51 // Returns true if there is at least one file extension registered 55 // Returns true if there is at least one file extension registered
(...skipping 13 matching lines...) Expand all
65 69
66 void ResetAutoOpen(); 70 void ResetAutoOpen();
67 71
68 private: 72 private:
69 void SaveAutoOpenState(); 73 void SaveAutoOpenState();
70 74
71 Profile* profile_; 75 Profile* profile_;
72 76
73 BooleanPrefMember prompt_for_download_; 77 BooleanPrefMember prompt_for_download_;
74 FilePathPrefMember download_path_; 78 FilePathPrefMember download_path_;
79 FilePathPrefMember save_file_path_;
80 base::FilePath incognito_save_file_path_;
75 IntegerPrefMember save_file_type_; 81 IntegerPrefMember save_file_type_;
76 82
77 // Set of file extensions to open at download completion. 83 // Set of file extensions to open at download completion.
78 struct AutoOpenCompareFunctor { 84 struct AutoOpenCompareFunctor {
79 bool operator()(const base::FilePath::StringType& a, 85 bool operator()(const base::FilePath::StringType& a,
80 const base::FilePath::StringType& b) const; 86 const base::FilePath::StringType& b) const;
81 }; 87 };
82 typedef std::set<base::FilePath::StringType, 88 typedef std::set<base::FilePath::StringType,
83 AutoOpenCompareFunctor> AutoOpenSet; 89 AutoOpenCompareFunctor> AutoOpenSet;
84 AutoOpenSet auto_open_; 90 AutoOpenSet auto_open_;
85 91
86 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); 92 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs);
87 }; 93 };
88 94
89 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ 95 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698