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

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

Issue 2439873002: Make all text buttons on download shelf work well with themes, not just (Closed)
Patch Set: dont set bg Created 4 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_item_view.h" 5 #include "chrome/browser/ui/views/download/download_item_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 LoadIcon(); 797 LoadIcon();
798 } 798 }
799 799
800 void DownloadItemView::UpdateColorsFromTheme() { 800 void DownloadItemView::UpdateColorsFromTheme() {
801 if (!GetThemeProvider()) 801 if (!GetThemeProvider())
802 return; 802 return;
803 803
804 SetBorder(base::MakeUnique<SeparatorBorder>(GetThemeProvider()->GetColor( 804 SetBorder(base::MakeUnique<SeparatorBorder>(GetThemeProvider()->GetColor(
805 ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR))); 805 ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR)));
806 806
807 SkColor text_color = GetTextColor();
808 if (dangerous_download_label_) 807 if (dangerous_download_label_)
809 dangerous_download_label_->SetEnabledColor(text_color); 808 dangerous_download_label_->SetEnabledColor(GetTextColor());
810 if (save_button_) 809 if (save_button_)
811 save_button_->SetEnabledTextColors(text_color); 810 shelf_->ConfigureButtonForTheme(save_button_);
812 if (discard_button_) 811 if (discard_button_)
813 discard_button_->SetEnabledTextColors(text_color); 812 shelf_->ConfigureButtonForTheme(discard_button_);
814 } 813 }
815 814
816 void DownloadItemView::ShowContextMenuImpl(const gfx::Rect& rect, 815 void DownloadItemView::ShowContextMenuImpl(const gfx::Rect& rect,
817 ui::MenuSourceType source_type) { 816 ui::MenuSourceType source_type) {
818 // Similar hack as in MenuButton. 817 // Similar hack as in MenuButton.
819 // We're about to show the menu from a mouse press. By showing from the 818 // We're about to show the menu from a mouse press. By showing from the
820 // mouse press event we block RootView in mouse dispatching. This also 819 // mouse press event we block RootView in mouse dispatching. This also
821 // appears to cause RootView to get a mouse pressed BEFORE the mouse 820 // appears to cause RootView to get a mouse pressed BEFORE the mouse
822 // release is seen, which means RootView sends us another mouse press no 821 // release is seen, which means RootView sends us another mouse press no
823 // matter where the user pressed. To force RootView to recalculate the 822 // matter where the user pressed. To force RootView to recalculate the
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 SchedulePaint(); 1108 SchedulePaint();
1110 } 1109 }
1111 1110
1112 SkColor DownloadItemView::GetTextColor() const { 1111 SkColor DownloadItemView::GetTextColor() const {
1113 return GetTextColorForThemeProvider(GetThemeProvider()); 1112 return GetTextColorForThemeProvider(GetThemeProvider());
1114 } 1113 }
1115 1114
1116 SkColor DownloadItemView::GetDimmedTextColor() const { 1115 SkColor DownloadItemView::GetDimmedTextColor() const {
1117 return SkColorSetA(GetTextColor(), 0xC7); 1116 return SkColorSetA(GetTextColor(), 0xC7);
1118 } 1117 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/download/download_item_view.h ('k') | chrome/browser/ui/views/download/download_shelf_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698