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

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

Issue 2094553002: MD - Fix coloring of buttons on DL shelf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 385
386 gfx::Size item_size = (*download_views_.rbegin())->GetPreferredSize(); 386 gfx::Size item_size = (*download_views_.rbegin())->GetPreferredSize();
387 return item_size.width() < available_width; 387 return item_size.width() < available_width;
388 } 388 }
389 389
390 void DownloadShelfView::UpdateColorsFromTheme() { 390 void DownloadShelfView::UpdateColorsFromTheme() {
391 if (show_all_view_ && close_button_ && GetThemeProvider()) { 391 if (show_all_view_ && close_button_ && GetThemeProvider()) {
392 set_background(views::Background::CreateSolidBackground( 392 set_background(views::Background::CreateSolidBackground(
393 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR))); 393 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TOOLBAR)));
394 394
395 if (!ui::MaterialDesignController::IsModeMaterial()) { 395 if (ui::MaterialDesignController::IsModeMaterial()) {
396 static_cast<views::LabelButton*>(show_all_view_)
sky 2016/06/23 15:28:00 grumble, static_cast, grumble. This cast is easy t
Evan Stade 2016/06/23 17:05:49 well hopefully we'll be able to rip out non-md cod
397 ->SetEnabledTextColors(GetThemeProvider()->GetColor(
398 ThemeProperties::COLOR_BOOKMARK_TEXT));
399 } else {
396 views::Link* show_all_view = static_cast<views::Link*>(show_all_view_); 400 views::Link* show_all_view = static_cast<views::Link*>(show_all_view_);
397 show_all_view->SetBackgroundColor(background()->get_color()); 401 show_all_view->SetBackgroundColor(background()->get_color());
398 show_all_view->SetEnabledColor( 402 show_all_view->SetEnabledColor(
399 GetThemeProvider()->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT)); 403 GetThemeProvider()->GetColor(ThemeProperties::COLOR_BOOKMARK_TEXT));
400 404
401 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 405 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
402 close_button_->SetBackground( 406 close_button_->SetBackground(
403 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT), 407 GetThemeProvider()->GetColor(ThemeProperties::COLOR_TAB_TEXT),
404 rb.GetImageSkiaNamed(IDR_CLOSE_1), 408 rb.GetImageSkiaNamed(IDR_CLOSE_1),
405 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK)); 409 rb.GetImageSkiaNamed(IDR_CLOSE_1_MASK));
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 493
490 content::DownloadItem* DownloadShelfView::GetDownloadItemForView(size_t i) { 494 content::DownloadItem* DownloadShelfView::GetDownloadItemForView(size_t i) {
491 if (ui::MaterialDesignController::IsModeMaterial()) 495 if (ui::MaterialDesignController::IsModeMaterial())
492 return static_cast<DownloadItemViewMd*>(download_views_[i])->download(); 496 return static_cast<DownloadItemViewMd*>(download_views_[i])->download();
493 return static_cast<DownloadItemView*>(download_views_[i])->download(); 497 return static_cast<DownloadItemView*>(download_views_[i])->download();
494 } 498 }
495 499
496 SkColor DownloadShelfView::GetTextColorForIconMd() { 500 SkColor DownloadShelfView::GetTextColorForIconMd() {
497 return DownloadItemViewMd::GetTextColorForThemeProvider(GetThemeProvider()); 501 return DownloadItemViewMd::GetTextColorForThemeProvider(GetThemeProvider());
498 } 502 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view_md.cc ('k') | ui/native_theme/native_theme_dark_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698