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

Issue 150216: Move download item to its own view and a xib, paving the way for a custom dow... (Closed)

Created:
11 years, 5 months ago by Nico
Modified:
9 years, 7 months ago
CC:
chromium-reviews_googlegroups.com, John Grabowski, Paul Godavari, Ben Goodger (Google)
Visibility:
Public.

Description

Move download item to its own view and a xib, paving the way for a custom download item view. I didn't change the look of the download items yet. The context menu is now in the download item xib as well. BUG=14659, 15098, 14660 TEST=Download something. Everything should look like before (except for the smaller icon), but the context menu items should be disabled/enabled and checked/unchecked correctly.

Patch Set 1 #

Patch Set 2 : show active or complete context menu, hook context menus up again #

Patch Set 3 : validate context menu items (ie. show disabled items as disabled and show checkmarks if appropriate) #

Patch Set 4 : update cl description #

Patch Set 5 : minor formatting #

Patch Set 6 : more minor formatting, some 80col violations #

Patch Set 7 : minor #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+925 lines, -195 lines) Patch
A chrome/app/nibs/en.lproj/DownloadItem.xib View 1 2 1 chunk +700 lines, -0 lines 0 comments Download
A chrome/browser/cocoa/download_item_controller.h View 1 1 chunk +39 lines, -0 lines 3 comments Download
A chrome/browser/cocoa/download_item_controller.mm View 1 2 3 4 5 1 chunk +129 lines, -0 lines 4 comments Download
M chrome/browser/cocoa/download_item_mac.h View 1 2 3 4 5 6 2 chunks +8 lines, -12 lines 0 comments Download
M chrome/browser/cocoa/download_item_mac.mm View 1 2 3 4 5 2 chunks +4 lines, -143 lines 0 comments Download
M chrome/browser/cocoa/download_shelf_controller.h View 3 chunks +7 lines, -3 lines 2 comments Download
M chrome/browser/cocoa/download_shelf_controller.mm View 1 2 chunks +34 lines, -2 lines 2 comments Download
M chrome/browser/cocoa/download_shelf_mac.h View 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/cocoa/download_shelf_mac.mm View 2 chunks +1 line, -32 lines 0 comments Download
M chrome/chrome.gyp View 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Nico
I'm on vacation until 7/16, so no hurries with the review. This fixes several download ...
11 years, 5 months ago (2009-07-02 10:20:05 UTC) #1
pink (ping after 24hrs)
11 years, 5 months ago (2009-07-06 21:45:20 UTC) #2
http://codereview.chromium.org/150216/diff/1048/1051
File chrome/browser/cocoa/download_item_controller.h (right):

http://codereview.chromium.org/150216/diff/1048/1051#newcode24
Line 24: scoped_ptr<DownloadShelfContextMenuMac> menu_bridge_;
objective-C naming (menuBridge) in objective-C classes.

http://codereview.chromium.org/150216/diff/1048/1051#newcode29
Line 29: download:(BaseDownloadItemModel*)download_model;
I'd name this |-initWithFrame:model:|, but that's just me.

http://codereview.chromium.org/150216/diff/1048/1051#newcode29
Line 29: download:(BaseDownloadItemModel*)download_model;
Fix param name to obj-C naming. Elsewhere in file too.

http://codereview.chromium.org/150216/diff/1048/1050
File chrome/browser/cocoa/download_item_controller.mm (right):

http://codereview.chromium.org/150216/diff/1048/1050#newcode5
Line 5: #import "download_item_controller.h"
use the full path (chrome/browser/cocoa/...)

http://codereview.chromium.org/150216/diff/1048/1050#newcode64
Line 64: FilePath download_path = download_model->download()->GetFileName();
obj-C naming for local variables. Elsewhere in the file as well.

http://codereview.chromium.org/150216/diff/1048/1050#newcode73
Line 73: [[NSWorkspace sharedWorkspace] iconForFileType:extension]];
we should use IconManager for this. We've discussed this before, when were we
planning on making it so?

http://codereview.chromium.org/150216/diff/1048/1050#newcode86
Line 86: - (BOOL)validateMenuItem:(NSMenuItem *)item {
I think it's ok to put the tags in the nib. Our main menus will already break if
they change. It also means that we don't have to make code changes every time a
new menu item is added (we just have to update the nib).

http://codereview.chromium.org/150216/diff/1048/1055
File chrome/browser/cocoa/download_shelf_controller.h (right):

http://codereview.chromium.org/150216/diff/1048/1055#newcode34
Line 34: std::vector<DownloadItemController*> download_item_controllers_;
use obj-C naming. Also, make this a NSMutableArray.

http://codereview.chromium.org/150216/diff/1048/1055#newcode46
Line 46: - (void)addDownloadItem:(BaseDownloadItemModel*)view;
is this a model or a view? The param name should probably be changed.

http://codereview.chromium.org/150216/diff/1048/1058
File chrome/browser/cocoa/download_shelf_controller.mm (right):

http://codereview.chromium.org/150216/diff/1048/1058#newcode163
Line 163: - (void)addDownloadItem:(BaseDownloadItemModel*)download_model {
use obj-C naming for param.

http://codereview.chromium.org/150216/diff/1048/1058#newcode173
Line 173: download_item_controllers_.push_back([[DownloadItemController alloc]
Why not use NSMutableArray? You shouldn't be putting NSObjects in a vector.

Powered by Google App Engine
This is Rietveld 408576698