| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 view that implements one download on the Download shelf. | 5 // A view 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 // gfx::AnimationDelegate implementation. | 129 // gfx::AnimationDelegate implementation. |
| 130 void AnimationProgressed(const gfx::Animation* animation) override; | 130 void AnimationProgressed(const gfx::Animation* animation) override; |
| 131 | 131 |
| 132 protected: | 132 protected: |
| 133 // Overridden from views::View: | 133 // Overridden from views::View: |
| 134 void OnPaint(gfx::Canvas* canvas) override; | 134 void OnPaint(gfx::Canvas* canvas) override; |
| 135 void OnFocus() override; | 135 void OnFocus() override; |
| 136 void OnBlur() override; | 136 void OnBlur() override; |
| 137 | 137 |
| 138 private: | 138 private: |
| 139 friend class DownloadItemViewTest; |
| 140 |
| 139 enum State { NORMAL = 0, HOT, PUSHED }; | 141 enum State { NORMAL = 0, HOT, PUSHED }; |
| 140 class DropDownButton; | 142 class DropDownButton; |
| 141 | 143 |
| 142 enum Mode { | 144 enum Mode { |
| 143 NORMAL_MODE = 0, // Showing download item. | 145 NORMAL_MODE = 0, // Showing download item. |
| 144 DANGEROUS_MODE, // Displaying the dangerous download warning. | 146 DANGEROUS_MODE, // Displaying the dangerous download warning. |
| 145 MALICIOUS_MODE // Displaying the malicious download warning. | 147 MALICIOUS_MODE // Displaying the malicious download warning. |
| 146 }; | 148 }; |
| 147 | 149 |
| 148 void OpenDownload(); | 150 void OpenDownload(); |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 std::unique_ptr<extensions::ExperienceSamplingEvent> sampling_event_; | 331 std::unique_ptr<extensions::ExperienceSamplingEvent> sampling_event_; |
| 330 | 332 |
| 331 // Method factory used to delay reenabling of the item when opening the | 333 // Method factory used to delay reenabling of the item when opening the |
| 332 // downloaded file. | 334 // downloaded file. |
| 333 base::WeakPtrFactory<DownloadItemView> weak_ptr_factory_; | 335 base::WeakPtrFactory<DownloadItemView> weak_ptr_factory_; |
| 334 | 336 |
| 335 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); | 337 DISALLOW_COPY_AND_ASSIGN(DownloadItemView); |
| 336 }; | 338 }; |
| 337 | 339 |
| 338 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H_ | 340 #endif // CHROME_BROWSER_UI_VIEWS_DOWNLOAD_DOWNLOAD_ITEM_VIEW_H_ |
| OLD | NEW |