| OLD | NEW |
| 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 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 LoadIcon(); | 796 LoadIcon(); |
| 797 } | 797 } |
| 798 | 798 |
| 799 void DownloadItemView::UpdateColorsFromTheme() { | 799 void DownloadItemView::UpdateColorsFromTheme() { |
| 800 if (!GetThemeProvider()) | 800 if (!GetThemeProvider()) |
| 801 return; | 801 return; |
| 802 | 802 |
| 803 SetBorder(base::MakeUnique<SeparatorBorder>(GetThemeProvider()->GetColor( | 803 SetBorder(base::MakeUnique<SeparatorBorder>(GetThemeProvider()->GetColor( |
| 804 ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR))); | 804 ThemeProperties::COLOR_TOOLBAR_VERTICAL_SEPARATOR))); |
| 805 | 805 |
| 806 SkColor text_color = GetTextColor(); | |
| 807 if (dangerous_download_label_) | 806 if (dangerous_download_label_) |
| 808 dangerous_download_label_->SetEnabledColor(text_color); | 807 dangerous_download_label_->SetEnabledColor(GetTextColor()); |
| 809 if (save_button_) | 808 if (save_button_) |
| 810 save_button_->SetEnabledTextColors(text_color); | 809 shelf_->ConfigureButtonForTheme(save_button_); |
| 811 if (discard_button_) | 810 if (discard_button_) |
| 812 discard_button_->SetEnabledTextColors(text_color); | 811 shelf_->ConfigureButtonForTheme(discard_button_); |
| 813 } | 812 } |
| 814 | 813 |
| 815 void DownloadItemView::ShowContextMenuImpl(const gfx::Rect& rect, | 814 void DownloadItemView::ShowContextMenuImpl(const gfx::Rect& rect, |
| 816 ui::MenuSourceType source_type) { | 815 ui::MenuSourceType source_type) { |
| 817 // Similar hack as in MenuButton. | 816 // Similar hack as in MenuButton. |
| 818 // We're about to show the menu from a mouse press. By showing from the | 817 // We're about to show the menu from a mouse press. By showing from the |
| 819 // mouse press event we block RootView in mouse dispatching. This also | 818 // mouse press event we block RootView in mouse dispatching. This also |
| 820 // appears to cause RootView to get a mouse pressed BEFORE the mouse | 819 // appears to cause RootView to get a mouse pressed BEFORE the mouse |
| 821 // release is seen, which means RootView sends us another mouse press no | 820 // release is seen, which means RootView sends us another mouse press no |
| 822 // matter where the user pressed. To force RootView to recalculate the | 821 // matter where the user pressed. To force RootView to recalculate the |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 SchedulePaint(); | 1107 SchedulePaint(); |
| 1109 } | 1108 } |
| 1110 | 1109 |
| 1111 SkColor DownloadItemView::GetTextColor() const { | 1110 SkColor DownloadItemView::GetTextColor() const { |
| 1112 return GetTextColorForThemeProvider(GetThemeProvider()); | 1111 return GetTextColorForThemeProvider(GetThemeProvider()); |
| 1113 } | 1112 } |
| 1114 | 1113 |
| 1115 SkColor DownloadItemView::GetDimmedTextColor() const { | 1114 SkColor DownloadItemView::GetDimmedTextColor() const { |
| 1116 return SkColorSetA(GetTextColor(), 0xC7); | 1115 return SkColorSetA(GetTextColor(), 0xC7); |
| 1117 } | 1116 } |
| OLD | NEW |