OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |