| 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 "base/memory/scoped_ptr.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 | 9 |
| 10 @class ChromeUILocalizer; | 10 @class ChromeUILocalizer; |
| 11 @class DownloadItemCell; | 11 @class DownloadItemCell; |
| 12 @class DownloadItemButton; | 12 @class DownloadItemButton; |
| 13 class DownloadItemMac; | 13 class DownloadItemMac; |
| 14 class DownloadItemModel; | 14 class DownloadItemModel; |
| 15 class DownloadShelfContextMenuMac; | 15 class DownloadShelfContextMenuMac; |
| 16 @class DownloadShelfController; | 16 @class DownloadShelfController; |
| 17 @class GTMWidthBasedTweaker; | 17 @class GTMWidthBasedTweaker; |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 class DownloadItem; | 20 class DownloadItem; |
| 21 class PageNavigator; | 21 class PageNavigator; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace extensions { |
| 25 class ExperienceSamplingEvent; |
| 26 } |
| 27 |
| 24 namespace gfx { | 28 namespace gfx { |
| 25 class FontList; | 29 class FontList; |
| 26 } | 30 } |
| 27 | 31 |
| 28 namespace ui { | 32 namespace ui { |
| 29 class MenuModel; | 33 class MenuModel; |
| 30 } | 34 } |
| 31 | 35 |
| 32 // A controller class that manages one download item. | 36 // A controller class that manages one download item. |
| 33 | 37 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 64 base::Time creationTime_; | 68 base::Time creationTime_; |
| 65 | 69 |
| 66 // Default font list to use for text metrics. | 70 // Default font list to use for text metrics. |
| 67 scoped_ptr<gfx::FontList> font_list_; | 71 scoped_ptr<gfx::FontList> font_list_; |
| 68 | 72 |
| 69 // The state of this item. | 73 // The state of this item. |
| 70 enum DownoadItemState { | 74 enum DownoadItemState { |
| 71 kNormal, | 75 kNormal, |
| 72 kDangerous | 76 kDangerous |
| 73 } state_; | 77 } state_; |
| 78 |
| 79 // ExperienceSampling: Track the state of dangerous downloads warnings. |
| 80 scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_; |
| 74 }; | 81 }; |
| 75 | 82 |
| 76 // Initialize controller for |downloadItem|. | 83 // Initialize controller for |downloadItem|. |
| 77 - (id)initWithDownload:(content::DownloadItem*)downloadItem | 84 - (id)initWithDownload:(content::DownloadItem*)downloadItem |
| 78 shelf:(DownloadShelfController*)shelf | 85 shelf:(DownloadShelfController*)shelf |
| 79 navigator:(content::PageNavigator*)navigator; | 86 navigator:(content::PageNavigator*)navigator; |
| 80 | 87 |
| 81 // Updates the UI and menu state from |downloadModel|. | 88 // Updates the UI and menu state from |downloadModel|. |
| 82 - (void)setStateFromDownload:(DownloadItemModel*)downloadModel; | 89 - (void)setStateFromDownload:(DownloadItemModel*)downloadModel; |
| 83 | 90 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 112 - (void)updateToolTip; | 119 - (void)updateToolTip; |
| 113 | 120 |
| 114 // Handling of dangerous downloads | 121 // Handling of dangerous downloads |
| 115 - (void)clearDangerousMode; | 122 - (void)clearDangerousMode; |
| 116 - (BOOL)isDangerousMode; | 123 - (BOOL)isDangerousMode; |
| 117 - (IBAction)saveDownload:(id)sender; | 124 - (IBAction)saveDownload:(id)sender; |
| 118 - (IBAction)discardDownload:(id)sender; | 125 - (IBAction)discardDownload:(id)sender; |
| 119 - (IBAction)dismissMaliciousDownload:(id)sender; | 126 - (IBAction)dismissMaliciousDownload:(id)sender; |
| 120 - (IBAction)showContextMenu:(id)sender; | 127 - (IBAction)showContextMenu:(id)sender; |
| 121 @end | 128 @end |
| OLD | NEW |