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> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/basictypes.h" | |
11 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/macros.h" |
12 #include "base/strings/string16.h" | 14 #include "base/strings/string16.h" |
13 | 15 |
14 class SavePackage; | 16 class SavePackage; |
15 | 17 |
16 namespace content { | 18 namespace content { |
17 class DownloadItem; | 19 class DownloadItem; |
18 } | 20 } |
19 | 21 |
20 namespace gfx { | 22 namespace gfx { |
21 class FontList; | 23 class FontList; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // is the maximum width of an embedded filename (if there is one). The metrics | 63 // is the maximum width of an embedded filename (if there is one). The metrics |
62 // for the filename will be based on |font_list|. Should only be called if | 64 // for the filename will be based on |font_list|. Should only be called if |
63 // IsDangerous() is true. | 65 // IsDangerous() is true. |
64 base::string16 GetWarningText(const gfx::FontList& font_list, int base_width)
const; | 66 base::string16 GetWarningText(const gfx::FontList& font_list, int base_width)
const; |
65 | 67 |
66 // Get the caption text for a button for confirming a dangerous download | 68 // Get the caption text for a button for confirming a dangerous download |
67 // warning. | 69 // warning. |
68 base::string16 GetWarningConfirmButtonText() const; | 70 base::string16 GetWarningConfirmButtonText() const; |
69 | 71 |
70 // Get the number of bytes that has completed so far. Virtual for testing. | 72 // Get the number of bytes that has completed so far. Virtual for testing. |
71 int64 GetCompletedBytes() const; | 73 int64_t GetCompletedBytes() const; |
72 | 74 |
73 // Get the total number of bytes for this download. Should return 0 if the | 75 // Get the total number of bytes for this download. Should return 0 if the |
74 // total size of the download is not known. Virual for testing. | 76 // total size of the download is not known. Virual for testing. |
75 int64 GetTotalBytes() const; | 77 int64_t GetTotalBytes() const; |
76 | 78 |
77 // Rough percent complete. Returns -1 if the progress is unknown. | 79 // Rough percent complete. Returns -1 if the progress is unknown. |
78 int PercentComplete() const; | 80 int PercentComplete() const; |
79 | 81 |
80 // Is this considered a dangerous download? | 82 // Is this considered a dangerous download? |
81 bool IsDangerous() const; | 83 bool IsDangerous() const; |
82 | 84 |
83 // Is this considered a malicious download? Implies IsDangerous(). | 85 // Is this considered a malicious download? Implies IsDangerous(). |
84 bool MightBeMalicious() const; | 86 bool MightBeMalicious() const; |
85 | 87 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 175 |
174 // The DownloadItem that this model represents. Note that DownloadItemModel | 176 // The DownloadItem that this model represents. Note that DownloadItemModel |
175 // itself shouldn't maintain any state since there can be more than one | 177 // itself shouldn't maintain any state since there can be more than one |
176 // DownloadItemModel in use with the same DownloadItem. | 178 // DownloadItemModel in use with the same DownloadItem. |
177 content::DownloadItem* download_; | 179 content::DownloadItem* download_; |
178 | 180 |
179 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); | 181 DISALLOW_COPY_AND_ASSIGN(DownloadItemModel); |
180 }; | 182 }; |
181 | 183 |
182 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ | 184 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_MODEL_H_ |
OLD | NEW |