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

Side by Side Diff: chrome/browser/ui/views/download/download_item_view_md.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_item_view_md.h" 5 #include "chrome/browser/ui/views/download/download_item_view_md.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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 if (last_download_item_path_ == current_download_path) 804 if (last_download_item_path_ == current_download_path)
805 return; 805 return;
806 806
807 LoadIcon(); 807 LoadIcon();
808 } 808 }
809 809
810 void DownloadItemViewMd::UpdateColorsFromTheme() { 810 void DownloadItemViewMd::UpdateColorsFromTheme() {
811 if (!GetThemeProvider()) 811 if (!GetThemeProvider())
812 return; 812 return;
813 813
814 if (dangerous_download_label_)
815 dangerous_download_label_->SetEnabledColor(GetTextColor());
816 SetBorder(base::WrapUnique(new SeparatorBorder(GetThemeProvider()->GetColor( 814 SetBorder(base::WrapUnique(new SeparatorBorder(GetThemeProvider()->GetColor(
817 ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR)))); 815 ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR))));
816
817 SkColor text_color = GetTextColor();
818 if (dangerous_download_label_)
819 dangerous_download_label_->SetEnabledColor(text_color);
820 if (save_button_)
821 save_button_->SetEnabledTextColors(text_color);
822 if (discard_button_)
823 discard_button_->SetEnabledTextColors(text_color);
818 } 824 }
819 825
820 void DownloadItemViewMd::ShowContextMenuImpl(const gfx::Rect& rect, 826 void DownloadItemViewMd::ShowContextMenuImpl(const gfx::Rect& rect,
821 ui::MenuSourceType source_type) { 827 ui::MenuSourceType source_type) {
822 // Similar hack as in MenuButton. 828 // Similar hack as in MenuButton.
823 // We're about to show the menu from a mouse press. By showing from the 829 // We're about to show the menu from a mouse press. By showing from the
824 // mouse press event we block RootView in mouse dispatching. This also 830 // mouse press event we block RootView in mouse dispatching. This also
825 // appears to cause RootView to get a mouse pressed BEFORE the mouse 831 // appears to cause RootView to get a mouse pressed BEFORE the mouse
826 // release is seen, which means RootView sends us another mouse press no 832 // release is seen, which means RootView sends us another mouse press no
827 // matter where the user pressed. To force RootView to recalculate the 833 // matter where the user pressed. To force RootView to recalculate the
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1134 SchedulePaint(); 1140 SchedulePaint();
1135 } 1141 }
1136 1142
1137 SkColor DownloadItemViewMd::GetTextColor() const { 1143 SkColor DownloadItemViewMd::GetTextColor() const {
1138 return GetTextColorForThemeProvider(GetThemeProvider()); 1144 return GetTextColorForThemeProvider(GetThemeProvider());
1139 } 1145 }
1140 1146
1141 SkColor DownloadItemViewMd::GetDimmedTextColor() const { 1147 SkColor DownloadItemViewMd::GetDimmedTextColor() const {
1142 return SkColorSetA(GetTextColor(), 0xC7); 1148 return SkColorSetA(GetTextColor(), 0xC7);
1143 } 1149 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698