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

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

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failing tests. Created 4 years, 9 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_utils.h" 10 #include "ui/gfx/color_utils.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698