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

Side by Side Diff: ui/views/animation/button_ink_drop_delegate.cc

Issue 1977793006: Pressing spacebar on toolbar buttons triggers the ripple effect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Formatting changes Created 4 years, 7 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/animation/button_ink_drop_delegate.h ('k') | ui/views/animation/ink_drop_delegate.h » ('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/animation/button_ink_drop_delegate.h" 5 #include "ui/views/animation/button_ink_drop_delegate.h"
6 6
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/events/scoped_target_handler.h" 8 #include "ui/events/scoped_target_handler.h"
9 #include "ui/views/animation/ink_drop.h" 9 #include "ui/views/animation/ink_drop.h"
10 #include "ui/views/animation/ink_drop_factory.h" 10 #include "ui/views/animation/ink_drop_factory.h"
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 void ButtonInkDropDelegate::SnapToActivated() { 30 void ButtonInkDropDelegate::SnapToActivated() {
31 ink_drop_->SnapToActivated(); 31 ink_drop_->SnapToActivated();
32 } 32 }
33 33
34 void ButtonInkDropDelegate::SetHovered(bool is_hovered) { 34 void ButtonInkDropDelegate::SetHovered(bool is_hovered) {
35 ink_drop_->SetHovered(is_hovered); 35 ink_drop_->SetHovered(is_hovered);
36 } 36 }
37 37
38 InkDropState ButtonInkDropDelegate::GetTargetInkDropState() const {
39 return ink_drop_->GetTargetInkDropState();
40 }
41
38 //////////////////////////////////////////////////////////////////////////////// 42 ////////////////////////////////////////////////////////////////////////////////
39 // ui::EventHandler: 43 // ui::EventHandler:
40 44
41 void ButtonInkDropDelegate::OnMouseEvent(ui::MouseEvent* event) { 45 void ButtonInkDropDelegate::OnMouseEvent(ui::MouseEvent* event) {
42 switch (event->type()) { 46 switch (event->type()) {
43 case ui::ET_MOUSE_ENTERED: 47 case ui::ET_MOUSE_ENTERED:
44 SetHovered(true); 48 SetHovered(true);
45 break; 49 break;
46 case ui::ET_MOUSE_EXITED: 50 case ui::ET_MOUSE_EXITED:
47 SetHovered(false); 51 SetHovered(false);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 current_ink_drop_state == InkDropState::DEACTIVATED)) { 91 current_ink_drop_state == InkDropState::DEACTIVATED)) {
88 // These InkDropStates automatically transition to the HIDDEN state so we 92 // These InkDropStates automatically transition to the HIDDEN state so we
89 // don't make an explicit call. Explicitly animating to HIDDEN in this case 93 // don't make an explicit call. Explicitly animating to HIDDEN in this case
90 // would prematurely pre-empt these animations. 94 // would prematurely pre-empt these animations.
91 return; 95 return;
92 } 96 }
93 ink_drop_->AnimateToState(ink_drop_state); 97 ink_drop_->AnimateToState(ink_drop_state);
94 } 98 }
95 99
96 } // namespace views 100 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/button_ink_drop_delegate.h ('k') | ui/views/animation/ink_drop_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698