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 "ui/views/controls/focusable_border.h" | 5 #include "ui/views/controls/focusable_border.h" |
6 | 6 |
7 #include "third_party/skia/include/core/SkPaint.h" | 7 #include "third_party/skia/include/core/SkPaint.h" |
8 #include "third_party/skia/include/core/SkPath.h" | 8 #include "third_party/skia/include/core/SkPath.h" |
9 #include "ui/base/material_design/material_design_controller.h" | 9 #include "ui/base/material_design/material_design_controller.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return gfx::Size(); | 78 return gfx::Size(); |
79 } | 79 } |
80 | 80 |
81 void FocusableBorder::SetInsets(int top, int left, int bottom, int right) { | 81 void FocusableBorder::SetInsets(int top, int left, int bottom, int right) { |
82 insets_.Set(top, left, bottom, right); | 82 insets_.Set(top, left, bottom, right); |
83 } | 83 } |
84 | 84 |
85 SkColor FocusableBorder::GetCurrentColor(const View& view) const { | 85 SkColor FocusableBorder::GetCurrentColor(const View& view) const { |
86 if (!use_default_color_) | 86 if (!use_default_color_) |
87 return override_color_; | 87 return override_color_; |
| 88 |
88 SkColor color = view.GetNativeTheme()->GetSystemColor( | 89 SkColor color = view.GetNativeTheme()->GetSystemColor( |
89 view.HasFocus() ? ui::NativeTheme::kColorId_FocusedBorderColor : | 90 view.HasFocus() ? ui::NativeTheme::kColorId_FocusedBorderColor : |
90 ui::NativeTheme::kColorId_UnfocusedBorderColor); | 91 ui::NativeTheme::kColorId_UnfocusedBorderColor); |
91 if (ui::MaterialDesignController::IsSecondaryUiMaterial() && !view.enabled()) | 92 if (ui::MaterialDesignController::IsSecondaryUiMaterial() && |
92 color = color_utils::BlendTowardOppositeLuma(color, 0x61); | 93 !view.enabled()) { |
| 94 return color_utils::BlendTowardOppositeLuma(color, |
| 95 gfx::kDisabledControlAlpha); |
| 96 } |
| 97 |
93 return color; | 98 return color; |
94 } | 99 } |
95 | 100 |
96 } // namespace views | 101 } // namespace views |
OLD | NEW |