| 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 | 9 |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/download/download_item_model.h" | 12 #include "chrome/browser/download/download_item_model.h" |
| 12 #include "chrome/browser/themes/theme_service.h" | 13 #include "chrome/browser/themes/theme_service.h" |
| 13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 14 #include "chrome/browser/ui/view_ids.h" | 15 #include "chrome/browser/ui/view_ids.h" |
| 15 #include "chrome/browser/ui/views/download/download_item_view.h" | 16 #include "chrome/browser/ui/views/download/download_item_view.h" |
| 16 #include "chrome/browser/ui/views/frame/browser_view.h" | 17 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 17 #include "content/browser/download/download_item.h" | 18 #include "content/browser/download/download_item.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 parent_->RemoveChildView(this); | 100 parent_->RemoveChildView(this); |
| 100 } | 101 } |
| 101 | 102 |
| 102 void DownloadShelfView::Init() { | 103 void DownloadShelfView::Init() { |
| 103 ResourceBundle &rb = ResourceBundle::GetSharedInstance(); | 104 ResourceBundle &rb = ResourceBundle::GetSharedInstance(); |
| 104 arrow_image_ = new views::ImageView(); | 105 arrow_image_ = new views::ImageView(); |
| 105 arrow_image_->SetImage(rb.GetBitmapNamed(IDR_DOWNLOADS_FAVICON)); | 106 arrow_image_->SetImage(rb.GetBitmapNamed(IDR_DOWNLOADS_FAVICON)); |
| 106 AddChildView(arrow_image_); | 107 AddChildView(arrow_image_); |
| 107 | 108 |
| 108 show_all_view_ = new views::Link( | 109 show_all_view_ = new views::Link( |
| 109 UTF16ToWide(l10n_util::GetStringUTF16(IDS_SHOW_ALL_DOWNLOADS))); | 110 l10n_util::GetStringUTF16(IDS_SHOW_ALL_DOWNLOADS)); |
| 110 show_all_view_->set_listener(this); | 111 show_all_view_->set_listener(this); |
| 111 AddChildView(show_all_view_); | 112 AddChildView(show_all_view_); |
| 112 | 113 |
| 113 close_button_ = new views::ImageButton(this); | 114 close_button_ = new views::ImageButton(this); |
| 114 close_button_->SetImage(views::CustomButton::BS_NORMAL, | 115 close_button_->SetImage(views::CustomButton::BS_NORMAL, |
| 115 rb.GetBitmapNamed(IDR_CLOSE_BAR)); | 116 rb.GetBitmapNamed(IDR_CLOSE_BAR)); |
| 116 close_button_->SetImage(views::CustomButton::BS_HOT, | 117 close_button_->SetImage(views::CustomButton::BS_HOT, |
| 117 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); | 118 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); |
| 118 close_button_->SetImage(views::CustomButton::BS_PUSHED, | 119 close_button_->SetImage(views::CustomButton::BS_PUSHED, |
| 119 rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); | 120 rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 const DownloadItemView* download_item_view) { | 444 const DownloadItemView* download_item_view) { |
| 444 gfx::Rect bounds = download_item_view->bounds(); | 445 gfx::Rect bounds = download_item_view->bounds(); |
| 445 | 446 |
| 446 #if defined(TOOLKIT_VIEWS) | 447 #if defined(TOOLKIT_VIEWS) |
| 447 bounds.set_height(bounds.height() - 1); | 448 bounds.set_height(bounds.height() - 1); |
| 448 bounds.Offset(0, 3); | 449 bounds.Offset(0, 3); |
| 449 #endif | 450 #endif |
| 450 | 451 |
| 451 return bounds; | 452 return bounds; |
| 452 } | 453 } |
| OLD | NEW |