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

Side by Side Diff: ui/views/controls/focusable_border.cc

Issue 2346893002: Share a common alpha value used for displaying disabled state in Harmony (Closed)
Patch Set: compiling is underrated 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 unified diff | Download patch
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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
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
OLDNEW
« no previous file with comments | « ui/views/controls/combobox/combobox.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698