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

Unified Diff: chrome/browser/ui/cocoa/download/download_item_controller.h

Issue 533883002: [Mac] Re-layout download shelf when danger state of item changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix lifetime issues and add more tests Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/download/download_item_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/download/download_item_controller.h
diff --git a/chrome/browser/ui/cocoa/download/download_item_controller.h b/chrome/browser/ui/cocoa/download/download_item_controller.h
index e9373f3e583cd6aa3cb5beac9dcf5a980bc192a8..91fab101492d635215d0e15cbcfa9d3c38e3347d 100644
--- a/chrome/browser/ui/cocoa/download/download_item_controller.h
+++ b/chrome/browser/ui/cocoa/download/download_item_controller.h
@@ -34,7 +34,42 @@ class MenuModel;
}
// A controller class that manages one download item.
-
+//
+// The view hierarchy is as follows:
+//
+// DownloadItemController
+// |
+// | A container that is showing one of its child views (progressView_ or
+// | dangerousDownloadView_) depending on whether the download is safe or not.
+// |
+// +-- progressView_ (instance of DownloadItemButton)
+// | |
+// | +-- cell_ (instance of DownloadItemCell)
+// |
+// +-- dangerousDownloadView_
+// |
+// | Contains the dangerous download warning. Dependong on whether the
+// | download is dangerous (e.g. dangerous due to type of file), or
+// | malicious (e.g. downloaded from a known malware site) only one of
+// | dangerousButtonTweaker_ or maliciousButtonTweaker_ will be visible at
+// | one time.
+// |
+// +-- dangerousDownloadLabel_
+// |
+// +-- image_
+// |
+// +-- dangerousButtonTweaker_
+// |
+// | Contains the 'Discard'/'Save' buttons for a dangerous download. This
+// | is a GTMWidthBasedTweaker that adjusts the width based on the text of
+// | buttons.
+// |
+// +-- maliciousButtonTweaker_
+//
+// Contains the 'Discard' button and the drop down context menu button.
+// This is a GTMWidthBasedTweaker that adjusts the width based on the
+// text of the 'Discard' button.
+//
@interface DownloadItemController : NSViewController {
@private
IBOutlet DownloadItemButton* progressView_;
@@ -71,7 +106,7 @@ class MenuModel;
scoped_ptr<gfx::FontList> font_list_;
// The state of this item.
- enum DownoadItemState {
+ enum DownloadItemState {
kNormal,
kDangerous
} state_;
@@ -126,4 +161,5 @@ class MenuModel;
- (IBAction)discardDownload:(id)sender;
- (IBAction)dismissMaliciousDownload:(id)sender;
- (IBAction)showContextMenu:(id)sender;
+
@end
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/download/download_item_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698