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" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
59 bool IsDownloadPathManaged() const; | 59 bool IsDownloadPathManaged() const; |
60 | 60 |
61 // Returns true if there is at least one file extension registered | 61 // Returns true if there is at least one file extension registered |
62 // for auto-open. | 62 // for auto-open. |
63 bool IsAutoOpenUsed() const; | 63 bool IsAutoOpenUsed() const; |
64 | 64 |
65 // Returns true if |path| should be opened automatically based on | 65 // Returns true if |path| should be opened automatically based on |
66 // |path.Extension()|. | 66 // |path.Extension()|. |
67 bool IsAutoOpenEnabledBasedOnExtension(const base::FilePath& path) const; | 67 bool IsAutoOpenEnabledBasedOnExtension(const base::FilePath& path) const; |
68 | 68 |
69 // Enables auto-open based on file extension. Returns true on success. | 69 // Enables auto-open based on file extension. Returns true on success. Will |
70 // TODO(phajdan.jr): Add WARN_UNUSED_RESULT here. | 70 // fail if the |file_name| is allowed to open automatically. |
Randy Smith (Not in Mondays)
2015/06/03 23:44:08
"is allowed" -> "isn't allowed"?
asanka
2015/06/04 15:30:48
Done.
| |
71 bool EnableAutoOpenBasedOnExtension(const base::FilePath& file_name); | 71 bool EnableAutoOpenBasedOnExtension(const base::FilePath& file_name); |
72 | 72 |
73 // Disables auto-open based on file extension. | 73 // Disables auto-open based on file extension. |
74 void DisableAutoOpenBasedOnExtension(const base::FilePath& file_name); | 74 void DisableAutoOpenBasedOnExtension(const base::FilePath& file_name); |
75 | 75 |
76 #if defined(OS_WIN) || defined(OS_LINUX) || \ | 76 #if defined(OS_WIN) || defined(OS_LINUX) || \ |
77 (defined(OS_MACOSX) && !defined(OS_IOS)) | 77 (defined(OS_MACOSX) && !defined(OS_IOS)) |
78 // Store the user preference to disk. If |should_open| is true, also disable | 78 // Store the user preference to disk. If |should_open| is true, also disable |
79 // the built-in PDF plugin. If |should_open| is false, enable the PDF plugin. | 79 // the built-in PDF plugin. If |should_open| is false, enable the PDF plugin. |
80 void SetShouldOpenPdfInSystemReader(bool should_open); | 80 void SetShouldOpenPdfInSystemReader(bool should_open); |
(...skipping 26 matching lines...) Expand all Loading... | |
107 | 107 |
108 #if defined(OS_WIN) || defined(OS_LINUX) || \ | 108 #if defined(OS_WIN) || defined(OS_LINUX) || \ |
109 (defined(OS_MACOSX) && !defined(OS_IOS)) | 109 (defined(OS_MACOSX) && !defined(OS_IOS)) |
110 bool should_open_pdf_in_system_reader_; | 110 bool should_open_pdf_in_system_reader_; |
111 #endif | 111 #endif |
112 | 112 |
113 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); | 113 DISALLOW_COPY_AND_ASSIGN(DownloadPrefs); |
114 }; | 114 }; |
115 | 115 |
116 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ | 116 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PREFS_H_ |
OLD | NEW |