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

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

Issue 2369353002: Adds a pref and a policy to decide if PDFs should always be opened externally. (Closed)
Patch Set: Rebase and move the friend decl in the ifdef. Created 4 years, 2 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
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"
11 #include "base/gtest_prod_util.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "build/build_config.h" 13 #include "build/build_config.h"
13 #include "components/prefs/pref_member.h" 14 #include "components/prefs/pref_member.h"
14 15
15 class PrefService; 16 class PrefService;
16 class Profile; 17 class Profile;
17 18
18 namespace content { 19 namespace content {
19 class BrowserContext; 20 class BrowserContext;
20 class DownloadManager; 21 class DownloadManager;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // Return whether the user prefers to open PDF downloads in the platform's 88 // Return whether the user prefers to open PDF downloads in the platform's
88 // default reader. 89 // default reader.
89 bool ShouldOpenPdfInSystemReader() const; 90 bool ShouldOpenPdfInSystemReader() const;
90 #endif 91 #endif
91 92
92 void ResetAutoOpen(); 93 void ResetAutoOpen();
93 94
94 private: 95 private:
95 void SaveAutoOpenState(); 96 void SaveAutoOpenState();
96 97
98 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX)
99 // Used by tests to switch off version checks for Adobe.
Bernhard Bauer 2016/09/29 08:44:35 Rename the method so it states that the checks are
pastarmovj 2016/09/29 12:14:41 Done.
100 void OverrideAdobeVersionCheckForTests();
101 #endif
102
97 Profile* profile_; 103 Profile* profile_;
98 104
99 BooleanPrefMember prompt_for_download_; 105 BooleanPrefMember prompt_for_download_;
100 FilePathPrefMember download_path_; 106 FilePathPrefMember download_path_;
101 FilePathPrefMember save_file_path_; 107 FilePathPrefMember save_file_path_;
102 IntegerPrefMember save_file_type_; 108 IntegerPrefMember save_file_type_;
103 109
104 // Set of file extensions to open at download completion. 110 // Set of file extensions to open at download completion.
105 struct AutoOpenCompareFunctor { 111 struct AutoOpenCompareFunctor {
106 bool operator()(const base::FilePath::StringType& a, 112 bool operator()(const base::FilePath::StringType& a,
107 const base::FilePath::StringType& b) const; 113 const base::FilePath::StringType& b) const;
108 }; 114 };
109 typedef std::set<base::FilePath::StringType, 115 typedef std::set<base::FilePath::StringType,
110 AutoOpenCompareFunctor> AutoOpenSet; 116 AutoOpenCompareFunctor> AutoOpenSet;
111 AutoOpenSet auto_open_; 117 AutoOpenSet auto_open_;
112 118
113 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX) 119 #if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_MACOSX)
114 bool should_open_pdf_in_system_reader_; 120 bool should_open_pdf_in_system_reader_;
121 bool override_adobe_version_check_for_tests_;
122
123 FRIEND_TEST_ALL_PREFIXES(DownloadPrefsTest, AlwaysOpenPdfExternally);
Bernhard Bauer 2016/09/29 08:44:35 Friend declarations go first in the private sectio
pastarmovj 2016/09/29 12:14:41 Done.
115 #endif 124 #endif
116 125
117 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); 126 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs);
118 }; 127 };
119 128
120 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ 129 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_prefs.cc » ('j') | chrome/browser/download/download_prefs.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698