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

Side by Side Diff: chrome/browser/download/download_shelf.cc

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/download/download_shelf.h" 5 #include "chrome/browser/download/download_shelf.h"
6 6
7 DownloadShelf::DownloadShelf() 7 DownloadShelf::DownloadShelf()
8 : should_show_on_unhide_(false), 8 : should_show_on_unhide_(false),
9 is_hidden_(false) {} 9 is_hidden_(false) {}
10 10
11 void DownloadShelf::AddDownload(DownloadItemModel* download_model) { 11 void DownloadShelf::AddDownload(content::DownloadItem* download) {
12 if (is_hidden_) 12 if (is_hidden_)
13 Unhide(); 13 Unhide();
14 Show(); 14 Show();
15 DoAddDownload(download_model); 15 DoAddDownload(download);
16 } 16 }
17 17
18 void DownloadShelf::Show() { 18 void DownloadShelf::Show() {
19 if (is_hidden_) { 19 if (is_hidden_) {
20 should_show_on_unhide_ = true; 20 should_show_on_unhide_ = true;
21 return; 21 return;
22 } 22 }
23 DoShow(); 23 DoShow();
24 } 24 }
25 25
(...skipping 17 matching lines...) Expand all
43 43
44 void DownloadShelf::Unhide() { 44 void DownloadShelf::Unhide() {
45 if (!is_hidden_) 45 if (!is_hidden_)
46 return; 46 return;
47 is_hidden_ = false; 47 is_hidden_ = false;
48 if (should_show_on_unhide_) { 48 if (should_show_on_unhide_) {
49 should_show_on_unhide_ = false; 49 should_show_on_unhide_ = false;
50 DoShow(); 50 DoShow();
51 } 51 }
52 } 52 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_shelf.h ('k') | chrome/browser/download/download_shelf_context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698