OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/examples/button_sticker_sheet.h" | 5 #include "ui/views/examples/button_sticker_sheet.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "ui/base/material_design/material_design_controller.h" | 8 #include "ui/base/material_design/material_design_controller.h" |
9 #include "ui/views/controls/button/button.h" | 9 #include "ui/views/controls/button/button.h" |
10 #include "ui/views/controls/button/md_text_button.h" | 10 #include "ui/views/controls/button/md_text_button.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 // Constructs a pair of MdTextButtons in the specified |state| with the | 66 // Constructs a pair of MdTextButtons in the specified |state| with the |
67 // specified |listener|, and returns them in |*primary| and |*secondary|. The | 67 // specified |listener|, and returns them in |*primary| and |*secondary|. The |
68 // button in |*primary| is a call-to-action button, and the button in | 68 // button in |*primary| is a call-to-action button, and the button in |
69 // |*secondary| is a regular button. | 69 // |*secondary| is a regular button. |
70 void MakeButtonsInState(MdTextButton** primary, | 70 void MakeButtonsInState(MdTextButton** primary, |
71 MdTextButton** secondary, | 71 MdTextButton** secondary, |
72 ButtonListener* listener, | 72 ButtonListener* listener, |
73 Button::ButtonState state) { | 73 Button::ButtonState state) { |
74 const base::string16 button_text = base::ASCIIToUTF16("Button"); | 74 const base::string16 button_text = base::ASCIIToUTF16("Button"); |
75 *primary = MdTextButton::CreateMdButton(listener, button_text); | 75 *primary = MdTextButton::Create(listener, button_text); |
76 (*primary)->SetCallToAction(true); | 76 (*primary)->SetCallToAction(true); |
77 (*primary)->SetState(state); | 77 (*primary)->SetState(state); |
78 | 78 |
79 *secondary = MdTextButton::CreateMdButton(listener, button_text); | 79 *secondary = MdTextButton::Create(listener, button_text); |
80 (*secondary)->SetState(state); | 80 (*secondary)->SetState(state); |
81 } | 81 } |
82 | 82 |
83 } // namespace | 83 } // namespace |
84 | 84 |
85 ButtonStickerSheet::ButtonStickerSheet() | 85 ButtonStickerSheet::ButtonStickerSheet() |
86 : ExampleBase("Button (Sticker Sheet)") {} | 86 : ExampleBase("Button (Sticker Sheet)") {} |
87 | 87 |
88 ButtonStickerSheet::~ButtonStickerSheet() {} | 88 ButtonStickerSheet::~ButtonStickerSheet() {} |
89 | 89 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 secondary->OnFocus(); | 122 secondary->OnFocus(); |
123 AddLabelledRowToGridLayout(layout, "Focused", {primary, secondary}); | 123 AddLabelledRowToGridLayout(layout, "Focused", {primary, secondary}); |
124 } | 124 } |
125 | 125 |
126 void ButtonStickerSheet::ButtonPressed(Button* button, const ui::Event& event) { | 126 void ButtonStickerSheet::ButtonPressed(Button* button, const ui::Event& event) { |
127 // Ignore button presses. | 127 // Ignore button presses. |
128 } | 128 } |
129 | 129 |
130 } // namespace examples | 130 } // namespace examples |
131 } // namespace views | 131 } // namespace views |
OLD | NEW |