| 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; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace gfx { | 28 namespace gfx { |
| 29 class FontList; | 29 class FontList; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace ui { | 32 namespace ui { |
| 33 class MenuModel; | 33 class MenuModel; |
| 34 } | 34 } |
| 35 | 35 |
| 36 // A controller class that manages one download item. | 36 // A controller class that manages one download item. |
| 37 | 37 // |
| 38 // The view hierarchy is as follows: |
| 39 // |
| 40 // DownloadItemController |
| 41 // | |
| 42 // | A container that is showing one of its child views (progressView_ or |
| 43 // | dangerousDownloadView_) depending on whether the download is safe or not. |
| 44 // | |
| 45 // +-- progressView_ (instance of DownloadItemButton) |
| 46 // | | |
| 47 // | +-- cell_ (instance of DownloadItemCell) |
| 48 // | |
| 49 // +-- dangerousDownloadView_ |
| 50 // | |
| 51 // | Contains the dangerous download warning. Dependong on whether the |
| 52 // | download is dangerous (e.g. dangerous due to type of file), or |
| 53 // | malicious (e.g. downloaded from a known malware site) only one of |
| 54 // | dangerousButtonTweaker_ or maliciousButtonTweaker_ will be visible at |
| 55 // | one time. |
| 56 // | |
| 57 // +-- dangerousDownloadLabel_ |
| 58 // | |
| 59 // +-- image_ |
| 60 // | |
| 61 // +-- dangerousButtonTweaker_ |
| 62 // | |
| 63 // | Contains the 'Discard'/'Save' buttons for a dangerous download. This |
| 64 // | is a GTMWidthBasedTweaker that adjusts the width based on the text of |
| 65 // | buttons. |
| 66 // | |
| 67 // +-- maliciousButtonTweaker_ |
| 68 // |
| 69 // Contains the 'Discard' button and the drop down context menu button. |
| 70 // This is a GTMWidthBasedTweaker that adjusts the width based on the |
| 71 // text of the 'Discard' button. |
| 72 // |
| 38 @interface DownloadItemController : NSViewController { | 73 @interface DownloadItemController : NSViewController { |
| 39 @private | 74 @private |
| 40 IBOutlet DownloadItemButton* progressView_; | 75 IBOutlet DownloadItemButton* progressView_; |
| 41 IBOutlet DownloadItemCell* cell_; | 76 IBOutlet DownloadItemCell* cell_; |
| 42 | 77 |
| 43 // This is shown instead of progressView_ for dangerous downloads. | 78 // This is shown instead of progressView_ for dangerous downloads. |
| 44 IBOutlet NSView* dangerousDownloadView_; | 79 IBOutlet NSView* dangerousDownloadView_; |
| 45 IBOutlet NSTextField* dangerousDownloadLabel_; | 80 IBOutlet NSTextField* dangerousDownloadLabel_; |
| 46 IBOutlet NSButton* dangerousDownloadConfirmButton_; | 81 IBOutlet NSButton* dangerousDownloadConfirmButton_; |
| 47 | 82 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 - (void)updateToolTip; | 155 - (void)updateToolTip; |
| 121 | 156 |
| 122 // Handling of dangerous downloads | 157 // Handling of dangerous downloads |
| 123 - (void)clearDangerousMode; | 158 - (void)clearDangerousMode; |
| 124 - (BOOL)isDangerousMode; | 159 - (BOOL)isDangerousMode; |
| 125 - (IBAction)saveDownload:(id)sender; | 160 - (IBAction)saveDownload:(id)sender; |
| 126 - (IBAction)discardDownload:(id)sender; | 161 - (IBAction)discardDownload:(id)sender; |
| 127 - (IBAction)dismissMaliciousDownload:(id)sender; | 162 - (IBAction)dismissMaliciousDownload:(id)sender; |
| 128 - (IBAction)showContextMenu:(id)sender; | 163 - (IBAction)showContextMenu:(id)sender; |
| 129 @end | 164 @end |
| OLD | NEW |