| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // A ChromeView that implements one download on the Download shelf. | 5 // A ChromeView that implements one download on the Download shelf. |
| 6 // Each DownloadItemView contains an application icon, a text label | 6 // Each DownloadItemView contains an application icon, a text label |
| 7 // indicating the download's file name, a text label indicating the | 7 // indicating the download's file name, a text label indicating the |
| 8 // download's status (such as the number of bytes downloaded so far) | 8 // download's status (such as the number of bytes downloaded so far) |
| 9 // and a button for canceling an in progress download, or opening | 9 // and a button for canceling an in progress download, or opening |
| 10 // the completed download. | 10 // the completed download. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 // Sets the state and triggers a repaint. | 152 // Sets the state and triggers a repaint. |
| 153 void SetState(State body_state, State drop_down_state); | 153 void SetState(State body_state, State drop_down_state); |
| 154 | 154 |
| 155 // Whether we are in the dangerous mode. | 155 // Whether we are in the dangerous mode. |
| 156 bool IsDangerousMode() { return body_state_ == DANGEROUS; } | 156 bool IsDangerousMode() { return body_state_ == DANGEROUS; } |
| 157 | 157 |
| 158 // Reverts from dangerous mode to normal download mode. | 158 // Reverts from dangerous mode to normal download mode. |
| 159 void ClearDangerousMode(); | 159 void ClearDangerousMode(); |
| 160 | 160 |
| 161 // Start displaying the dangerous download warning. |
| 162 void EnterDangerousMode(); |
| 163 |
| 161 // Sets |size| with the size of the Save and Discard buttons (they have the | 164 // Sets |size| with the size of the Save and Discard buttons (they have the |
| 162 // same size). | 165 // same size). |
| 163 gfx::Size GetButtonSize(); | 166 gfx::Size GetButtonSize(); |
| 164 | 167 |
| 165 // Sizes the dangerous download label to a minimum width available using 2 | 168 // Sizes the dangerous download label to a minimum width available using 2 |
| 166 // lines. The size is computed only the first time this method is invoked | 169 // lines. The size is computed only the first time this method is invoked |
| 167 // and simply returned on subsequent calls. | 170 // and simply returned on subsequent calls. |
| 168 void SizeLabelToMinWidth(); | 171 void SizeLabelToMinWidth(); |
| 169 | 172 |
| 170 // Reenables the item after it has been disabled when a user clicked it to | 173 // Reenables the item after it has been disabled when a user clicked it to |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 | 288 |
| 286 // The icon loaded in the download shelf is based on the file path of the | 289 // The icon loaded in the download shelf is based on the file path of the |
| 287 // item. Store the path used, so that we can detect a change in the path | 290 // item. Store the path used, so that we can detect a change in the path |
| 288 // and reload the icon. | 291 // and reload the icon. |
| 289 FilePath last_download_item_path_; | 292 FilePath last_download_item_path_; |
| 290 | 293 |
| 291 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); | 294 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); |
| 292 }; | 295 }; |
| 293 | 296 |
| 294 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__ | 297 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H__ |
| OLD | NEW |