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

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

Issue 2033553003: Add MD ink drop ripple to shelf app items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed TODO 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/custom_button.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/base/material_design/material_design_controller.h" 8 #include "ui/base/material_design/material_design_controller.h"
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/event_utils.h" 10 #include "ui/events/event_utils.h"
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 CustomButton::CustomButton(ButtonListener* listener) 401 CustomButton::CustomButton(ButtonListener* listener)
402 : Button(listener), 402 : Button(listener),
403 state_(STATE_NORMAL), 403 state_(STATE_NORMAL),
404 hover_animation_(this), 404 hover_animation_(this),
405 animate_on_state_change_(true), 405 animate_on_state_change_(true),
406 is_throbbing_(false), 406 is_throbbing_(false),
407 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON), 407 triggerable_event_flags_(ui::EF_LEFT_MOUSE_BUTTON),
408 request_focus_on_press_(false), 408 request_focus_on_press_(false),
409 notify_action_(NOTIFY_ON_RELEASE), 409 notify_action_(NOTIFY_ON_RELEASE),
410 has_ink_drop_action_on_click_(false), 410 has_ink_drop_action_on_click_(false),
411 ink_drop_action_on_click_(InkDropState::ACTION_TRIGGERED),
412 hide_ink_drop_when_showing_context_menu_(true), 411 hide_ink_drop_when_showing_context_menu_(true),
413 ink_drop_base_color_(gfx::kPlaceholderColor) { 412 ink_drop_base_color_(gfx::kPlaceholderColor) {
414 hover_animation_.SetSlideDuration(kHoverFadeDurationMs); 413 hover_animation_.SetSlideDuration(kHoverFadeDurationMs);
415 } 414 }
416 415
417 void CustomButton::StateChanged() { 416 void CustomButton::StateChanged() {
418 } 417 }
419 418
420 bool CustomButton::IsTriggerableEvent(const ui::Event& event) { 419 bool CustomButton::IsTriggerableEvent(const ui::Event& event) {
421 return event.type() == ui::ET_GESTURE_TAP_DOWN || 420 return event.type() == ui::ET_GESTURE_TAP_DOWN ||
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 #endif 454 #endif
456 455
457 return check_mouse_position && IsMouseHovered(); 456 return check_mouse_position && IsMouseHovered();
458 } 457 }
459 458
460 //////////////////////////////////////////////////////////////////////////////// 459 ////////////////////////////////////////////////////////////////////////////////
461 // CustomButton, Button overrides (protected): 460 // CustomButton, Button overrides (protected):
462 461
463 void CustomButton::NotifyClick(const ui::Event& event) { 462 void CustomButton::NotifyClick(const ui::Event& event) {
464 if (has_ink_drop_action_on_click_) 463 if (has_ink_drop_action_on_click_)
465 AnimateInkDrop(ink_drop_action_on_click_); 464 AnimateInkDrop(InkDropState::ACTION_TRIGGERED);
466 Button::NotifyClick(event); 465 Button::NotifyClick(event);
467 } 466 }
468 467
469 void CustomButton::OnClickCanceled(const ui::Event& event) { 468 void CustomButton::OnClickCanceled(const ui::Event& event) {
470 AnimateInkDrop(views::InkDropState::HIDDEN); 469 AnimateInkDrop(views::InkDropState::HIDDEN);
471 Button::OnClickCanceled(event); 470 Button::OnClickCanceled(event);
472 } 471 }
473 472
474 } // namespace views 473 } // namespace views
OLDNEW
« no previous file with comments | « 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