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

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

Issue 2178163002: Add ink drop ripple to shelf overflow button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed OnClickCanceled Created 4 years, 3 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 (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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 463
464 void CustomButton::NotifyClick(const ui::Event& event) { 464 void CustomButton::NotifyClick(const ui::Event& event) {
465 if (has_ink_drop_action_on_click_) { 465 if (has_ink_drop_action_on_click_) {
466 AnimateInkDrop(InkDropState::ACTION_TRIGGERED, 466 AnimateInkDrop(InkDropState::ACTION_TRIGGERED,
467 ui::LocatedEvent::FromIfValid(&event)); 467 ui::LocatedEvent::FromIfValid(&event));
468 } 468 }
469 Button::NotifyClick(event); 469 Button::NotifyClick(event);
470 } 470 }
471 471
472 void CustomButton::OnClickCanceled(const ui::Event& event) { 472 void CustomButton::OnClickCanceled(const ui::Event& event) {
473 AnimateInkDrop(views::InkDropState::HIDDEN, 473 if (ink_drop()->GetTargetInkDropState() ==
474 ui::LocatedEvent::FromIfValid(&event)); 474 views::InkDropState::ACTION_PENDING ||
475 ink_drop()->GetTargetInkDropState() ==
476 views::InkDropState::ALTERNATE_ACTION_PENDING) {
477 AnimateInkDrop(views::InkDropState::HIDDEN,
478 ui::LocatedEvent::FromIfValid(&event));
479 }
475 Button::OnClickCanceled(event); 480 Button::OnClickCanceled(event);
476 } 481 }
477 482
478 } // namespace views 483 } // namespace views
OLDNEW
« ash/test/shelf_view_test_api.cc ('K') | « ui/views/animation/ink_drop_host_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698