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

Side by Side Diff: chrome/browser/ui/cocoa/download/download_shelf_mac.mm

Issue 11673004: No need to pass DownloadItemModel ownership. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DownloadShelfContextMenu class cleanup and require GetMenuModel() to return non-NULL Created 7 years, 11 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) 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 #include "chrome/browser/ui/cocoa/download/download_shelf_mac.h" 5 #include "chrome/browser/ui/cocoa/download/download_shelf_mac.h"
6 6
7 #include "chrome/browser/download/download_item_model.h" 7 #include "chrome/browser/download/download_item_model.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" 9 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h"
10 #include "chrome/browser/ui/cocoa/download/download_item_mac.h" 10 #include "chrome/browser/ui/cocoa/download/download_item_mac.h"
11 11
12 DownloadShelfMac::DownloadShelfMac(Browser* browser, 12 DownloadShelfMac::DownloadShelfMac(Browser* browser,
13 DownloadShelfController* controller) 13 DownloadShelfController* controller)
14 : browser_(browser), 14 : browser_(browser),
15 shelf_controller_(controller) { 15 shelf_controller_(controller) {
16 } 16 }
17 17
18 void DownloadShelfMac::DoAddDownload(DownloadItemModel* download_model) { 18 void DownloadShelfMac::DoAddDownload(content::DownloadItem* download) {
19 [shelf_controller_ addDownloadItem:download_model]; 19 [shelf_controller_ addDownloadItem:download];
20 } 20 }
21 21
22 bool DownloadShelfMac::IsShowing() const { 22 bool DownloadShelfMac::IsShowing() const {
23 return [shelf_controller_ isVisible] == YES; 23 return [shelf_controller_ isVisible] == YES;
24 } 24 }
25 25
26 bool DownloadShelfMac::IsClosing() const { 26 bool DownloadShelfMac::IsClosing() const {
27 // TODO(estade): This is never called. For now just return false. 27 // TODO(estade): This is never called. For now just return false.
28 return false; 28 return false;
29 } 29 }
30 30
31 void DownloadShelfMac::DoShow() { 31 void DownloadShelfMac::DoShow() {
32 [shelf_controller_ show:nil]; 32 [shelf_controller_ show:nil];
33 browser_->UpdateDownloadShelfVisibility(true); 33 browser_->UpdateDownloadShelfVisibility(true);
34 } 34 }
35 35
36 void DownloadShelfMac::DoClose() { 36 void DownloadShelfMac::DoClose() {
37 [shelf_controller_ hide:nil]; 37 [shelf_controller_ hide:nil];
38 browser_->UpdateDownloadShelfVisibility(false); 38 browser_->UpdateDownloadShelfVisibility(false);
39 } 39 }
40 40
41 Browser* DownloadShelfMac::browser() const { 41 Browser* DownloadShelfMac::browser() const {
42 return browser_; 42 return browser_;
43 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/download/download_shelf_mac.h ('k') | chrome/browser/ui/gtk/download/download_item_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698