| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include <memory> |
| 8 |
| 8 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 9 | 10 |
| 10 @class ChromeUILocalizer; | 11 @class ChromeUILocalizer; |
| 11 @class DownloadItemCell; | 12 @class DownloadItemCell; |
| 12 @class DownloadItemButton; | 13 @class DownloadItemButton; |
| 13 class DownloadItemMac; | 14 class DownloadItemMac; |
| 14 class DownloadItemModel; | 15 class DownloadItemModel; |
| 15 class DownloadShelfContextMenuMac; | 16 class DownloadShelfContextMenuMac; |
| 16 @class DownloadShelfController; | 17 @class DownloadShelfController; |
| 17 @class GTMWidthBasedTweaker; | 18 @class GTMWidthBasedTweaker; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 IBOutlet GTMWidthBasedTweaker* maliciousButtonTweaker_; | 87 IBOutlet GTMWidthBasedTweaker* maliciousButtonTweaker_; |
| 87 | 88 |
| 88 // Because the confirm text and button for dangerous downloads are determined | 89 // Because the confirm text and button for dangerous downloads are determined |
| 89 // at runtime, an outlet to the localizer is needed to construct the layout | 90 // at runtime, an outlet to the localizer is needed to construct the layout |
| 90 // tweaker in awakeFromNib in order to adjust the UI after all strings are | 91 // tweaker in awakeFromNib in order to adjust the UI after all strings are |
| 91 // determined. | 92 // determined. |
| 92 IBOutlet ChromeUILocalizer* localizer_; | 93 IBOutlet ChromeUILocalizer* localizer_; |
| 93 | 94 |
| 94 IBOutlet NSImageView* image_; | 95 IBOutlet NSImageView* image_; |
| 95 | 96 |
| 96 scoped_ptr<DownloadItemMac> bridge_; | 97 std::unique_ptr<DownloadItemMac> bridge_; |
| 97 scoped_ptr<DownloadShelfContextMenuMac> menuBridge_; | 98 std::unique_ptr<DownloadShelfContextMenuMac> menuBridge_; |
| 98 | 99 |
| 99 // Weak pointer to the shelf that owns us. | 100 // Weak pointer to the shelf that owns us. |
| 100 DownloadShelfController* shelf_; | 101 DownloadShelfController* shelf_; |
| 101 | 102 |
| 102 // The time at which this view was created. | 103 // The time at which this view was created. |
| 103 base::Time creationTime_; | 104 base::Time creationTime_; |
| 104 | 105 |
| 105 // Default font list to use for text metrics. | 106 // Default font list to use for text metrics. |
| 106 scoped_ptr<gfx::FontList> font_list_; | 107 std::unique_ptr<gfx::FontList> font_list_; |
| 107 | 108 |
| 108 // The state of this item. | 109 // The state of this item. |
| 109 enum DownloadItemState { | 110 enum DownloadItemState { |
| 110 kNormal, | 111 kNormal, |
| 111 kDangerous | 112 kDangerous |
| 112 } state_; | 113 } state_; |
| 113 | 114 |
| 114 // ExperienceSampling: This tracks dangerous/malicious downloads warning UI | 115 // ExperienceSampling: This tracks dangerous/malicious downloads warning UI |
| 115 // and the user's decisions about it. | 116 // and the user's decisions about it. |
| 116 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_; | 117 std::unique_ptr<extensions::ExperienceSamplingEvent> sampling_event_; |
| 117 }; | 118 }; |
| 118 | 119 |
| 119 // Initialize controller for |downloadItem|. | 120 // Initialize controller for |downloadItem|. |
| 120 - (id)initWithDownload:(content::DownloadItem*)downloadItem | 121 - (id)initWithDownload:(content::DownloadItem*)downloadItem |
| 121 shelf:(DownloadShelfController*)shelf | 122 shelf:(DownloadShelfController*)shelf |
| 122 navigator:(content::PageNavigator*)navigator; | 123 navigator:(content::PageNavigator*)navigator; |
| 123 | 124 |
| 124 // Updates the UI and menu state from |downloadModel|. | 125 // Updates the UI and menu state from |downloadModel|. |
| 125 - (void)setStateFromDownload:(DownloadItemModel*)downloadModel; | 126 - (void)setStateFromDownload:(DownloadItemModel*)downloadModel; |
| 126 | 127 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 156 | 157 |
| 157 // Handling of dangerous downloads | 158 // Handling of dangerous downloads |
| 158 - (void)clearDangerousMode; | 159 - (void)clearDangerousMode; |
| 159 - (BOOL)isDangerousMode; | 160 - (BOOL)isDangerousMode; |
| 160 - (IBAction)saveDownload:(id)sender; | 161 - (IBAction)saveDownload:(id)sender; |
| 161 - (IBAction)discardDownload:(id)sender; | 162 - (IBAction)discardDownload:(id)sender; |
| 162 - (IBAction)dismissMaliciousDownload:(id)sender; | 163 - (IBAction)dismissMaliciousDownload:(id)sender; |
| 163 - (IBAction)showContextMenu:(id)sender; | 164 - (IBAction)showContextMenu:(id)sender; |
| 164 | 165 |
| 165 @end | 166 @end |
| OLD | NEW |