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