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_shelf_view.h" | 5 #include "chrome/browser/ui/views/download_shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | |
11 #include "base/logging.h" | 10 #include "base/logging.h" |
12 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
13 #include "chrome/browser/download/download_item.h" | 12 #include "chrome/browser/download/download_item.h" |
14 #include "chrome/browser/download/download_item_model.h" | 13 #include "chrome/browser/download/download_item_model.h" |
15 #include "chrome/browser/download/download_manager.h" | 14 #include "chrome/browser/download/download_manager.h" |
16 #include "chrome/browser/tab_contents/navigation_entry.h" | 15 #include "chrome/browser/tab_contents/navigation_entry.h" |
17 #include "chrome/browser/themes/browser_theme_provider.h" | 16 #include "chrome/browser/themes/browser_theme_provider.h" |
18 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/view_ids.h" | 18 #include "chrome/browser/ui/view_ids.h" |
20 #include "chrome/browser/ui/views/download_item_view.h" | 19 #include "chrome/browser/ui/views/download_item_view.h" |
21 #include "chrome/browser/ui/views/frame/browser_view.h" | 20 #include "chrome/browser/ui/views/frame/browser_view.h" |
22 #include "gfx/canvas.h" | 21 #include "gfx/canvas.h" |
23 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
24 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
25 #include "ui/base/animation/slide_animation.h" | 24 #include "ui/base/animation/slide_animation.h" |
| 25 #include "ui/base/resource/resource_bundle.h" |
26 #include "views/background.h" | 26 #include "views/background.h" |
27 #include "views/controls/button/image_button.h" | 27 #include "views/controls/button/image_button.h" |
28 #include "views/controls/image_view.h" | 28 #include "views/controls/image_view.h" |
29 | 29 |
30 // Max number of download views we'll contain. Any time a view is added and | 30 // Max number of download views we'll contain. Any time a view is added and |
31 // we already have this many download views, one is removed. | 31 // we already have this many download views, one is removed. |
32 static const size_t kMaxDownloadViews = 15; | 32 static const size_t kMaxDownloadViews = 15; |
33 | 33 |
34 // Padding from left edge and first download view. | 34 // Padding from left edge and first download view. |
35 static const int kLeftPadding = 2; | 35 static const int kLeftPadding = 2; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 const DownloadItemView* download_item_view) { | 433 const DownloadItemView* download_item_view) { |
434 gfx::Rect bounds = download_item_view->bounds(); | 434 gfx::Rect bounds = download_item_view->bounds(); |
435 | 435 |
436 #if defined(TOOLKIT_VIEWS) | 436 #if defined(TOOLKIT_VIEWS) |
437 bounds.set_height(bounds.height() - 1); | 437 bounds.set_height(bounds.height() - 1); |
438 bounds.Offset(0, 3); | 438 bounds.Offset(0, 3); |
439 #endif | 439 #endif |
440 | 440 |
441 return bounds; | 441 return bounds; |
442 } | 442 } |
OLD | NEW |