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

Unified Diff: ui/views/controls/link.cc

Issue 2389453002: Remove IsModeMaterial checks in ui/views/ (Closed)
Patch Set: oops Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/link.h ('k') | ui/views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/link.cc
diff --git a/ui/views/controls/link.cc b/ui/views/controls/link.cc
index 405625b6637353a5c12fffc23a04ca733a1375b3..176330bf30d9b30cd87727d89e05cf340cc780d5 100644
--- a/ui/views/controls/link.cc
+++ b/ui/views/controls/link.cc
@@ -30,9 +30,7 @@ Link::Link() : Link(base::string16()) {}
Link::Link(const base::string16& title)
: Label(title),
requested_enabled_color_(gfx::kPlaceholderColor),
- requested_enabled_color_set_(false),
- requested_pressed_color_(gfx::kPlaceholderColor),
- requested_pressed_color_set_(false) {
+ requested_enabled_color_set_(false) {
Init();
}
@@ -176,12 +174,6 @@ void Link::SetEnabledColor(SkColor color) {
Label::SetEnabledColor(GetEnabledColor());
}
-void Link::SetPressedColor(SkColor color) {
- requested_pressed_color_set_ = true;
- requested_pressed_color_ = color;
- Label::SetEnabledColor(GetEnabledColor());
-}
-
void Link::SetUnderline(bool underline) {
if (underline_ == underline)
return;
@@ -241,21 +233,16 @@ void Link::ConfigureFocus() {
}
SkColor Link::GetEnabledColor() {
- // In material mode, there is no pressed effect, so always use the unpressed
- // color.
- if (!pressed_ || ui::MaterialDesignController::IsModeMaterial()) {
- if (!requested_enabled_color_set_ && GetNativeTheme())
- return GetNativeTheme()->GetSystemColor(
- ui::NativeTheme::kColorId_LinkEnabled);
-
+ if (requested_enabled_color_set_)
Evan Stade 2016/09/30 22:57:38 here is a behavior change. The default NativeThem
return requested_enabled_color_;
- }
- if (!requested_pressed_color_set_ && GetNativeTheme())
+ if (GetNativeTheme()) {
return GetNativeTheme()->GetSystemColor(
- ui::NativeTheme::kColorId_LinkPressed);
+ pressed_ ? ui::NativeTheme::kColorId_LinkPressed
+ : ui::NativeTheme::kColorId_LinkEnabled);
+ }
- return requested_pressed_color_;
+ return gfx::kPlaceholderColor;
}
} // namespace views
« no previous file with comments | « ui/views/controls/link.h ('k') | ui/views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698