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

Side by Side Diff: ui/views/controls/button/md_text_button.cc

Issue 2637383003: Change Painter factory functions to unique_ptr (Closed)
Patch Set: msw review Created 3 years, 11 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/button/label_button_border.cc ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/button/md_text_button.h" 5 #include "ui/views/controls/button/md_text_button.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.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 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 292
293 // Disabled, non-prominent buttons need their stroke lightened. Prominent 293 // Disabled, non-prominent buttons need their stroke lightened. Prominent
294 // buttons need it left at SK_ColorTRANSPARENT from above. 294 // buttons need it left at SK_ColorTRANSPARENT from above.
295 if (state() == STATE_DISABLED && !is_prominent_) { 295 if (state() == STATE_DISABLED && !is_prominent_) {
296 stroke_color = color_utils::BlendTowardOppositeLuma( 296 stroke_color = color_utils::BlendTowardOppositeLuma(
297 stroke_color, gfx::kDisabledControlAlpha); 297 stroke_color, gfx::kDisabledControlAlpha);
298 } 298 }
299 299
300 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color))); 300 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color)));
301 set_background(Background::CreateBackgroundPainter( 301 set_background(Background::CreateBackgroundPainter(
302 true, Painter::CreateRoundRectWith1PxBorderPainter( 302 Painter::CreateRoundRectWith1PxBorderPainter(bg_color, stroke_color,
303 bg_color, stroke_color, kInkDropSmallCornerRadius))); 303 kInkDropSmallCornerRadius)));
304 } 304 }
305 305
306 } // namespace views 306 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/label_button_border.cc ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698