OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/download/download_shelf_view.h" | 5 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
12 #include "chrome/browser/download/download_item_model.h" | 12 #include "chrome/browser/download/download_item_model.h" |
13 #include "chrome/browser/themes/theme_service.h" | 13 #include "chrome/browser/themes/theme_service.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/view_ids.h" | 15 #include "chrome/browser/ui/view_ids.h" |
16 #include "chrome/browser/ui/views/download/download_item_view.h" | 16 #include "chrome/browser/ui/views/download/download_item_view.h" |
17 #include "chrome/browser/ui/views/frame/browser_view.h" | 17 #include "chrome/browser/ui/views/frame/browser_view.h" |
18 #include "content/browser/download/download_item.h" | 18 #include "content/browser/download/download_item.h" |
19 #include "content/browser/download/download_manager.h" | 19 #include "content/browser/download/download_manager.h" |
20 #include "content/browser/download/download_stats.h" | 20 #include "content/browser/download/download_stats.h" |
21 #include "content/browser/tab_contents/navigation_entry.h" | 21 #include "content/browser/tab_contents/navigation_entry.h" |
22 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
23 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
24 #include "grit/theme_resources_standard.h" | 24 #include "grit/theme_resources_standard.h" |
25 #include "ui/base/animation/slide_animation.h" | 25 #include "ui/base/animation/slide_animation.h" |
26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
28 #include "ui/gfx/canvas.h" | 28 #include "ui/gfx/canvas.h" |
| 29 #include "ui/views/background.h" |
29 #include "ui/views/controls/button/image_button.h" | 30 #include "ui/views/controls/button/image_button.h" |
30 #include "ui/views/controls/image_view.h" | 31 #include "ui/views/controls/image_view.h" |
31 #include "ui/views/controls/link.h" | 32 #include "ui/views/controls/link.h" |
32 #include "views/background.h" | |
33 | 33 |
34 // Max number of download views we'll contain. Any time a view is added and | 34 // Max number of download views we'll contain. Any time a view is added and |
35 // we already have this many download views, one is removed. | 35 // we already have this many download views, one is removed. |
36 static const size_t kMaxDownloadViews = 15; | 36 static const size_t kMaxDownloadViews = 15; |
37 | 37 |
38 // Padding from left edge and first download view. | 38 // Padding from left edge and first download view. |
39 static const int kLeftPadding = 2; | 39 static const int kLeftPadding = 2; |
40 | 40 |
41 // Padding from right edge and close button/show downloads link. | 41 // Padding from right edge and close button/show downloads link. |
42 static const int kRightPadding = 10; | 42 static const int kRightPadding = 10; |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 const DownloadItemView* download_item_view) { | 463 const DownloadItemView* download_item_view) { |
464 gfx::Rect bounds = download_item_view->bounds(); | 464 gfx::Rect bounds = download_item_view->bounds(); |
465 | 465 |
466 #if defined(TOOLKIT_VIEWS) | 466 #if defined(TOOLKIT_VIEWS) |
467 bounds.set_height(bounds.height() - 1); | 467 bounds.set_height(bounds.height() - 1); |
468 bounds.Offset(0, 3); | 468 bounds.Offset(0, 3); |
469 #endif | 469 #endif |
470 | 470 |
471 return bounds; | 471 return bounds; |
472 } | 472 } |
OLD | NEW |