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

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

Issue 1550443002: Pushed InkDropHost inheritence up to CustomButton. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/custom_button.h" 5 #include "ui/views/controls/button/custom_button.h"
6 6
7 #include "ui/accessibility/ax_view_state.h" 7 #include "ui/accessibility/ax_view_state.h"
8 #include "ui/events/event.h" 8 #include "ui/events/event.h"
9 #include "ui/events/event_utils.h" 9 #include "ui/events/event_utils.h"
10 #include "ui/events/keycodes/keyboard_codes.h" 10 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 324 }
325 325
326 //////////////////////////////////////////////////////////////////////////////// 326 ////////////////////////////////////////////////////////////////////////////////
327 // CustomButton, gfx::AnimationDelegate implementation: 327 // CustomButton, gfx::AnimationDelegate implementation:
328 328
329 void CustomButton::AnimationProgressed(const gfx::Animation* animation) { 329 void CustomButton::AnimationProgressed(const gfx::Animation* animation) {
330 SchedulePaint(); 330 SchedulePaint();
331 } 331 }
332 332
333 //////////////////////////////////////////////////////////////////////////////// 333 ////////////////////////////////////////////////////////////////////////////////
334 // CustomButton, views::InkDropHost implementation:
335
336 void CustomButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {}
337
338 void CustomButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {}
Peter Kasting 2015/12/28 13:44:33 Having to override these just to give empty implem
bruthig 2015/12/28 17:36:16 I agree that would simplify things but I thought t
Peter Kasting 2015/12/28 17:38:41 I don't consider this to be qualitatively differen
bruthig 2015/12/28 18:35:40 Done.
339
340 gfx::Point CustomButton::CalculateInkDropCenter() const {
341 return GetLocalBounds().CenterPoint();
342 }
343
344 ////////////////////////////////////////////////////////////////////////////////
334 // CustomButton, protected: 345 // CustomButton, protected:
335 346
336 CustomButton::CustomButton(ButtonListener* listener) 347 CustomButton::CustomButton(ButtonListener* listener)
337 : Button(listener), 348 : Button(listener),
338 state_(STATE_NORMAL), 349 state_(STATE_NORMAL),
339 animate_on_state_change_(true), 350 animate_on_state_change_(true),
340 is_throbbing_(false), 351 is_throbbing_(false),
341 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), 352 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON),
342 request_focus_on_press_(true), 353 request_focus_on_press_(true),
343 ink_drop_delegate_(nullptr), 354 ink_drop_delegate_(nullptr),
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget(); 433 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget();
423 } 434 }
424 435
425 bool CustomButton::FocusInChildWidget() const { 436 bool CustomButton::FocusInChildWidget() const {
426 return GetWidget() && 437 return GetWidget() &&
427 GetWidget()->GetRootView()->Contains( 438 GetWidget()->GetRootView()->Contains(
428 GetFocusManager()->GetFocusedView()); 439 GetFocusManager()->GetFocusedView());
429 } 440 }
430 441
431 } // namespace views 442 } // namespace views
OLDNEW
« chrome/browser/ui/views/bar_control_button.h ('K') | « ui/views/controls/button/custom_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698