Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Side by Side Diff: chrome/browser/ui/views/download/download_shelf_view.cc

Issue 1406613002: For some vector icons, get the size from the vector definition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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"
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 this, l10n_util::GetStringUTF16(IDS_SHOW_ALL_DOWNLOADS_MD)); 165 this, l10n_util::GetStringUTF16(IDS_SHOW_ALL_DOWNLOADS_MD));
166 show_all_view->SetFocusable(true); 166 show_all_view->SetFocusable(true);
167 show_all_view->SetStyle(views::Button::STYLE_BUTTON); 167 show_all_view->SetStyle(views::Button::STYLE_BUTTON);
168 show_all_view_ = show_all_view; 168 show_all_view_ = show_all_view;
169 169
170 // TODO(estade): share this button init code with the find in page bar; 170 // TODO(estade): share this button init code with the find in page bar;
171 // also fix theming. 171 // also fix theming.
172 close_button_->SetBorder(views::Border::CreateEmptyBorder(4, 4, 4, 4)); 172 close_button_->SetBorder(views::Border::CreateEmptyBorder(4, 4, 4, 4));
173 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER, 173 close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
174 views::ImageButton::ALIGN_MIDDLE); 174 views::ImageButton::ALIGN_MIDDLE);
175 gfx::ImageSkia image = gfx::CreateVectorIcon(gfx::VectorIconId::BAR_CLOSE, 175 gfx::ImageSkia image = gfx::CreatePrimaryVectorIcon(
176 16, gfx::kChromeIconGrey); 176 gfx::VectorIconId::BAR_CLOSE, gfx::kChromeIconGrey);
177 close_button_->SetImage(views::CustomButton::STATE_NORMAL, &image); 177 close_button_->SetImage(views::CustomButton::STATE_NORMAL, &image);
178 } 178 }
179 AddChildView(show_all_view_); 179 AddChildView(show_all_view_);
180 AddChildView(close_button_); 180 AddChildView(close_button_);
181 181
182 new_item_animation_.SetSlideDuration(kNewItemAnimationDurationMs); 182 new_item_animation_.SetSlideDuration(kNewItemAnimationDurationMs);
183 shelf_animation_.SetSlideDuration(kShelfAnimationDurationMs); 183 shelf_animation_.SetSlideDuration(kShelfAnimationDurationMs);
184 } 184 }
185 185
186 DownloadShelfView::~DownloadShelfView() { 186 DownloadShelfView::~DownloadShelfView() {
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 return false; 487 return false;
488 } 488 }
489 return true; 489 return true;
490 } 490 }
491 491
492 content::DownloadItem* DownloadShelfView::GetDownloadItemForView(size_t i) { 492 content::DownloadItem* DownloadShelfView::GetDownloadItemForView(size_t i) {
493 if (ui::MaterialDesignController::IsModeMaterial()) 493 if (ui::MaterialDesignController::IsModeMaterial())
494 return static_cast<DownloadItemViewMd*>(download_views_[i])->download(); 494 return static_cast<DownloadItemViewMd*>(download_views_[i])->download();
495 return static_cast<DownloadItemView*>(download_views_[i])->download(); 495 return static_cast<DownloadItemView*>(download_views_[i])->download();
496 } 496 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698