OLD | NEW |
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_utils.h" | 10 #include "ui/gfx/color_utils.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 LabelButton::SetText(base::i18n::ToUpper(text)); | 101 LabelButton::SetText(base::i18n::ToUpper(text)); |
102 } | 102 } |
103 | 103 |
104 MdTextButton::MdTextButton(ButtonListener* listener) | 104 MdTextButton::MdTextButton(ButtonListener* listener) |
105 : LabelButton(listener, base::string16()), | 105 : LabelButton(listener, base::string16()), |
106 ink_drop_delegate_(this, this), | 106 ink_drop_delegate_(this, this), |
107 focus_ring_(new MdFocusRing()) { | 107 focus_ring_(new MdFocusRing()) { |
108 set_ink_drop_delegate(&ink_drop_delegate_); | 108 set_ink_drop_delegate(&ink_drop_delegate_); |
109 set_has_ink_drop_action_on_click(true); | 109 set_has_ink_drop_action_on_click(true); |
110 SetHorizontalAlignment(gfx::ALIGN_CENTER); | 110 SetHorizontalAlignment(gfx::ALIGN_CENTER); |
111 SetFocusable(true); | 111 SetFocusBehavior(FocusBehavior::CONTROL); |
112 SetMinSize(gfx::Size(kMinWidth, 0)); | 112 SetMinSize(gfx::Size(kMinWidth, 0)); |
113 | 113 |
114 AddChildView(focus_ring_); | 114 AddChildView(focus_ring_); |
115 focus_ring_->SetVisible(false); | 115 focus_ring_->SetVisible(false); |
116 SetFocusPainter(nullptr); | 116 SetFocusPainter(nullptr); |
117 set_request_focus_on_press(false); | 117 set_request_focus_on_press(false); |
118 } | 118 } |
119 | 119 |
120 MdTextButton::~MdTextButton() {} | 120 MdTextButton::~MdTextButton() {} |
121 | 121 |
122 } // namespace views | 122 } // namespace views |
OLD | NEW |