| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/views/download_shelf_view.h" | 5 #include "chrome/browser/views/download_shelf_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "app/gfx/canvas.h" | |
| 10 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 11 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| 12 #include "base/logging.h" | 11 #include "base/logging.h" |
| 13 #include "chrome/browser/browser.h" | 12 #include "chrome/browser/browser.h" |
| 14 #include "chrome/browser/browser_theme_provider.h" | 13 #include "chrome/browser/browser_theme_provider.h" |
| 15 #include "chrome/browser/download/download_item_model.h" | 14 #include "chrome/browser/download/download_item_model.h" |
| 16 #include "chrome/browser/download/download_manager.h" | 15 #include "chrome/browser/download/download_manager.h" |
| 17 #include "chrome/browser/tab_contents/navigation_entry.h" | 16 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 18 #include "chrome/browser/view_ids.h" | 17 #include "chrome/browser/view_ids.h" |
| 19 #include "chrome/browser/views/download_item_view.h" | 18 #include "chrome/browser/views/download_item_view.h" |
| 20 #include "chrome/browser/views/frame/browser_view.h" | 19 #include "chrome/browser/views/frame/browser_view.h" |
| 20 #include "gfx/canvas.h" |
| 21 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 22 #include "grit/theme_resources.h" | 22 #include "grit/theme_resources.h" |
| 23 #include "views/background.h" | 23 #include "views/background.h" |
| 24 #include "views/controls/button/image_button.h" | 24 #include "views/controls/button/image_button.h" |
| 25 #include "views/controls/image_view.h" | 25 #include "views/controls/image_view.h" |
| 26 | 26 |
| 27 // Max number of download views we'll contain. Any time a view is added and | 27 // Max number of download views we'll contain. Any time a view is added and |
| 28 // we already have this many download views, one is removed. | 28 // we already have this many download views, one is removed. |
| 29 static const size_t kMaxDownloadViews = 15; | 29 static const size_t kMaxDownloadViews = 15; |
| 30 | 30 |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 bool is_transfer_done = download->state() == DownloadItem::COMPLETE || | 339 bool is_transfer_done = download->state() == DownloadItem::COMPLETE || |
| 340 download->state() == DownloadItem::CANCELLED; | 340 download->state() == DownloadItem::CANCELLED; |
| 341 if (is_transfer_done && | 341 if (is_transfer_done && |
| 342 download->safety_state() != DownloadItem::DANGEROUS) { | 342 download->safety_state() != DownloadItem::DANGEROUS) { |
| 343 RemoveDownloadView(download_views_[i]); | 343 RemoveDownloadView(download_views_[i]); |
| 344 } else { | 344 } else { |
| 345 ++i; | 345 ++i; |
| 346 } | 346 } |
| 347 } | 347 } |
| 348 } | 348 } |
| OLD | NEW |