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

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

Issue 2389453002: Remove IsModeMaterial checks in ui/views/ (Closed)
Patch Set: oops Created 4 years, 2 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
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 "ui/base/material_design/material_design_controller.h" 8 #include "ui/base/material_design/material_design_controller.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/gfx/color_palette.h" 10 #include "ui/gfx/color_palette.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 canvas->DrawRoundRect(rect, kFocusBorderCornerRadius, paint); 81 canvas->DrawRoundRect(rect, kFocusBorderCornerRadius, paint);
82 } 82 }
83 83
84 private: 84 private:
85 DISALLOW_COPY_AND_ASSIGN(MdFocusRing); 85 DISALLOW_COPY_AND_ASSIGN(MdFocusRing);
86 }; 86 };
87 87
88 } // namespace internal 88 } // namespace internal
89 89
90 // static 90 // static
91 LabelButton* MdTextButton::CreateStandardButton(ButtonListener* listener,
92 const base::string16& text) {
93 return CreateButton(listener, text,
94 ui::MaterialDesignController::IsModeMaterial());
95 }
96
97 // static
98 LabelButton* MdTextButton::CreateSecondaryUiButton(ButtonListener* listener, 91 LabelButton* MdTextButton::CreateSecondaryUiButton(ButtonListener* listener,
99 const base::string16& text) { 92 const base::string16& text) {
100 return CreateButton(listener, text, 93 return CreateButton(listener, text,
101 ui::MaterialDesignController::IsSecondaryUiMaterial()); 94 ui::MaterialDesignController::IsSecondaryUiMaterial());
102 } 95 }
103 96
104 // static 97 // static
105 LabelButton* MdTextButton::CreateSecondaryUiBlueButton( 98 LabelButton* MdTextButton::CreateSecondaryUiBlueButton(
106 ButtonListener* listener, 99 ButtonListener* listener,
107 const base::string16& text) { 100 const base::string16& text) {
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 ? SkColorSetA(SK_ColorBLACK, kStrokeOpacity) 317 ? SkColorSetA(SK_ColorBLACK, kStrokeOpacity)
325 : SkColorSetA(SK_ColorWHITE, 2 * kStrokeOpacity); 318 : SkColorSetA(SK_ColorWHITE, 2 * kStrokeOpacity);
326 319
327 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color))); 320 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color)));
328 set_background(Background::CreateBackgroundPainter( 321 set_background(Background::CreateBackgroundPainter(
329 true, Painter::CreateRoundRectWith1PxBorderPainter( 322 true, Painter::CreateRoundRectWith1PxBorderPainter(
330 bg_color, stroke_color, kInkDropSmallCornerRadius))); 323 bg_color, stroke_color, kInkDropSmallCornerRadius)));
331 } 324 }
332 325
333 } // namespace views 326 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698