Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: chrome/browser/ui/cocoa/download/download_item_controller.h

Issue 9569011: Refactor dangerous download warning text generation into DownloadItemModel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update copyright headers Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 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.h" 8 #include "base/time.h"
9 9
10 class BaseDownloadItemModel; 10 class BaseDownloadItemModel;
11 @class ChromeUILocalizer; 11 @class ChromeUILocalizer;
12 @class DownloadItemCell; 12 @class DownloadItemCell;
13 @class DownloadItemButton; 13 @class DownloadItemButton;
14 class DownloadItemMac; 14 class DownloadItemMac;
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 } 21 }
22 22
23 namespace gfx {
24 class Font;
25 }
26
23 // A controller class that manages one download item. 27 // A controller class that manages one download item.
24 28
25 @interface DownloadItemController : NSViewController { 29 @interface DownloadItemController : NSViewController {
26 @private 30 @private
27 IBOutlet DownloadItemButton* progressView_; 31 IBOutlet DownloadItemButton* progressView_;
28 IBOutlet DownloadItemCell* cell_; 32 IBOutlet DownloadItemCell* cell_;
29 33
30 IBOutlet NSMenu* activeDownloadMenu_; 34 IBOutlet NSMenu* activeDownloadMenu_;
31 IBOutlet NSMenu* completeDownloadMenu_; 35 IBOutlet NSMenu* completeDownloadMenu_;
32 36
(...skipping 16 matching lines...) Expand all
49 53
50 scoped_ptr<DownloadItemMac> bridge_; 54 scoped_ptr<DownloadItemMac> bridge_;
51 scoped_ptr<DownloadShelfContextMenuMac> menuBridge_; 55 scoped_ptr<DownloadShelfContextMenuMac> menuBridge_;
52 56
53 // Weak pointer to the shelf that owns us. 57 // Weak pointer to the shelf that owns us.
54 DownloadShelfController* shelf_; 58 DownloadShelfController* shelf_;
55 59
56 // The time at which this view was created. 60 // The time at which this view was created.
57 base::Time creationTime_; 61 base::Time creationTime_;
58 62
63 // Default font to use for text metrics.
64 scoped_ptr<gfx::Font> font_;
65
59 // The state of this item. 66 // The state of this item.
60 enum DownoadItemState { 67 enum DownoadItemState {
61 kNormal, 68 kNormal,
62 kDangerous 69 kDangerous
63 } state_; 70 } state_;
64 }; 71 };
65 72
66 // Takes ownership of |downloadModel|. 73 // Takes ownership of |downloadModel|.
67 - (id)initWithModel:(BaseDownloadItemModel*)downloadModel 74 - (id)initWithModel:(BaseDownloadItemModel*)downloadModel
68 shelf:(DownloadShelfController*)shelf; 75 shelf:(DownloadShelfController*)shelf;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 - (IBAction)discardDownload:(id)sender; 109 - (IBAction)discardDownload:(id)sender;
103 110
104 // Context menu handlers. 111 // Context menu handlers.
105 - (IBAction)handleOpen:(id)sender; 112 - (IBAction)handleOpen:(id)sender;
106 - (IBAction)handleAlwaysOpen:(id)sender; 113 - (IBAction)handleAlwaysOpen:(id)sender;
107 - (IBAction)handleReveal:(id)sender; 114 - (IBAction)handleReveal:(id)sender;
108 - (IBAction)handleCancel:(id)sender; 115 - (IBAction)handleCancel:(id)sender;
109 - (IBAction)handleTogglePause:(id)sender; 116 - (IBAction)handleTogglePause:(id)sender;
110 117
111 @end 118 @end
OLDNEW
« no previous file with comments | « chrome/browser/download/download_shelf_context_menu.cc ('k') | chrome/browser/ui/cocoa/download/download_item_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698