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_ITEM_MODEL_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ |
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
15 #include "chrome/browser/download/download_target_info.h" | 15 #include "chrome/browser/download/download_target_info.h" |
| 16 #include "chrome/common/safe_browsing/download_file_types.pb.h" |
16 | 17 |
17 class SavePackage; | 18 class SavePackage; |
18 | 19 |
19 namespace content { | 20 namespace content { |
20 class DownloadItem; | 21 class DownloadItem; |
21 } | 22 } |
22 | 23 |
23 namespace gfx { | 24 namespace gfx { |
24 class FontList; | 25 class FontList; |
25 } | 26 } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // Returns |true| if opening in the browser is preferred for this download. If | 137 // Returns |true| if opening in the browser is preferred for this download. If |
137 // |false|, the download should be opened with the system default application. | 138 // |false|, the download should be opened with the system default application. |
138 bool ShouldPreferOpeningInBrowser() const; | 139 bool ShouldPreferOpeningInBrowser() const; |
139 | 140 |
140 // Change what's returned by ShouldPreferOpeningInBrowser to |preference|. | 141 // Change what's returned by ShouldPreferOpeningInBrowser to |preference|. |
141 void SetShouldPreferOpeningInBrowser(bool preference); | 142 void SetShouldPreferOpeningInBrowser(bool preference); |
142 | 143 |
143 // Return the danger level determined during download target determination. | 144 // Return the danger level determined during download target determination. |
144 // The value returned here is independent of the danger level as determined by | 145 // The value returned here is independent of the danger level as determined by |
145 // the Safe Browsing. | 146 // the Safe Browsing. |
146 download_util::DownloadDangerLevel GetDangerLevel() const; | 147 safe_browsing::DownloadFileType::DangerLevel GetDangerLevel() const; |
147 | 148 |
148 // Change what's returned by GetDangerLevel(). | 149 // Change what's returned by GetDangerLevel(). |
149 void SetDangerLevel(download_util::DownloadDangerLevel danger_level); | 150 void SetDangerLevel( |
| 151 safe_browsing::DownloadFileType::DangerLevel danger_level); |
150 | 152 |
151 // Open the download using the platform handler for the download. The behavior | 153 // Open the download using the platform handler for the download. The behavior |
152 // of this method will be different from DownloadItem::OpenDownload() if | 154 // of this method will be different from DownloadItem::OpenDownload() if |
153 // ShouldPreferOpeningInBrowser(). | 155 // ShouldPreferOpeningInBrowser(). |
154 void OpenUsingPlatformHandler(); | 156 void OpenUsingPlatformHandler(); |
155 | 157 |
156 // Whether the download was removed and this is currently being undone. | 158 // Whether the download was removed and this is currently being undone. |
157 bool IsBeingRevived() const; | 159 bool IsBeingRevived() const; |
158 | 160 |
159 // Set whether the download is being revived. | 161 // Set whether the download is being revived. |
(...skipping 14 matching lines...) Expand all Loading... |
174 | 176 |
175 // The DownloadItem that this model represents. Note that DownloadItemModel | 177 // The DownloadItem that this model represents. Note that DownloadItemModel |
176 // itself shouldn't maintain any state since there can be more than one | 178 // itself shouldn't maintain any state since there can be more than one |
177 // DownloadItemModel in use with the same DownloadItem. | 179 // DownloadItemModel in use with the same DownloadItem. |
178 content::DownloadItem* download_; | 180 content::DownloadItem* download_; |
179 | 181 |
180 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); | 182 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); |
181 }; | 183 }; |
182 | 184 |
183 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ | 185 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ |
OLD | NEW |