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

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

Issue 2041033002: Moved ButtonInkDropDelegate logic into InkDropHostView and deleted InkDropDelegates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed merge conflict in custom_button.cc Created 4 years, 6 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/md_text_button.h ('k') | ui/views/controls/button/menu_button.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 "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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 if (!is_default()) 166 if (!is_default())
167 SetCallToAction(NO_CALL_TO_ACTION); 167 SetCallToAction(NO_CALL_TO_ACTION);
168 else if (cta_ == NO_CALL_TO_ACTION) 168 else if (cta_ == NO_CALL_TO_ACTION)
169 SetCallToAction(WEAK_CALL_TO_ACTION); 169 SetCallToAction(WEAK_CALL_TO_ACTION);
170 } 170 }
171 171
172 MdTextButton::MdTextButton(ButtonListener* listener) 172 MdTextButton::MdTextButton(ButtonListener* listener)
173 : LabelButton(listener, base::string16()), 173 : LabelButton(listener, base::string16()),
174 focus_ring_(new MdFocusRing()), 174 focus_ring_(new MdFocusRing()),
175 cta_(NO_CALL_TO_ACTION) { 175 cta_(NO_CALL_TO_ACTION) {
176 set_ink_drop_delegate( 176 SetHasInkDrop(true);
177 base::WrapUnique(new ButtonInkDropDelegate(this, this)));
178 set_has_ink_drop_action_on_click(true); 177 set_has_ink_drop_action_on_click(true);
179 SetHorizontalAlignment(gfx::ALIGN_CENTER); 178 SetHorizontalAlignment(gfx::ALIGN_CENTER);
180 SetFocusForPlatform(); 179 SetFocusForPlatform();
181 SetMinSize(gfx::Size(kMinWidth, 0)); 180 SetMinSize(gfx::Size(kMinWidth, 0));
182 SetFocusPainter(nullptr); 181 SetFocusPainter(nullptr);
183 label()->SetAutoColorReadabilityEnabled(false); 182 label()->SetAutoColorReadabilityEnabled(false);
184 183
185 AddChildView(focus_ring_); 184 AddChildView(focus_ring_);
186 focus_ring_->SetVisible(false); 185 focus_ring_->SetVisible(false);
187 set_request_focus_on_press(false); 186 set_request_focus_on_press(false);
(...skipping 26 matching lines...) Expand all
214 cta_ == STRONG_CALL_TO_ACTION 213 cta_ == STRONG_CALL_TO_ACTION
215 ? Background::CreateBackgroundPainter( 214 ? Background::CreateBackgroundPainter(
216 true, Painter::CreateSolidRoundRectPainter( 215 true, Painter::CreateSolidRoundRectPainter(
217 theme->GetSystemColor( 216 theme->GetSystemColor(
218 ui::NativeTheme::kColorId_CallToActionColor), 217 ui::NativeTheme::kColorId_CallToActionColor),
219 kInkDropSmallCornerRadius)) 218 kInkDropSmallCornerRadius))
220 : nullptr); 219 : nullptr);
221 } 220 }
222 221
223 } // namespace views 222 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/md_text_button.h ('k') | ui/views/controls/button/menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698