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

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

Issue 2001843002: Use ink drop hover for focus states on toolbar buttons and location (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: layout 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.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 21 matching lines...) Expand all
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 { 38 InkDropState ButtonInkDropDelegate::GetTargetInkDropState() const {
39 return ink_drop_->GetTargetInkDropState(); 39 return ink_drop_->GetTargetInkDropState();
40 } 40 }
41 41
42 InkDrop* ButtonInkDropDelegate::GetInkDrop() {
43 return ink_drop_.get();
44 }
45
42 //////////////////////////////////////////////////////////////////////////////// 46 ////////////////////////////////////////////////////////////////////////////////
43 // ui::EventHandler: 47 // ui::EventHandler:
44 48
45 void ButtonInkDropDelegate::OnMouseEvent(ui::MouseEvent* event) { 49 void ButtonInkDropDelegate::OnMouseEvent(ui::MouseEvent* event) {
46 switch (event->type()) { 50 switch (event->type()) {
47 case ui::ET_MOUSE_ENTERED: 51 case ui::ET_MOUSE_ENTERED:
48 SetHovered(true); 52 SetHovered(true);
49 break; 53 break;
50 case ui::ET_MOUSE_EXITED: 54 case ui::ET_MOUSE_EXITED:
51 SetHovered(false); 55 SetHovered(false);
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 current_ink_drop_state == InkDropState::DEACTIVATED)) { 95 current_ink_drop_state == InkDropState::DEACTIVATED)) {
92 // These InkDropStates automatically transition to the HIDDEN state so we 96 // These InkDropStates automatically transition to the HIDDEN state so we
93 // don't make an explicit call. Explicitly animating to HIDDEN in this case 97 // don't make an explicit call. Explicitly animating to HIDDEN in this case
94 // would prematurely pre-empt these animations. 98 // would prematurely pre-empt these animations.
95 return; 99 return;
96 } 100 }
97 ink_drop_->AnimateToState(ink_drop_state); 101 ink_drop_->AnimateToState(ink_drop_state);
98 } 102 }
99 103
100 } // namespace views 104 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/button_ink_drop_delegate.h ('k') | ui/views/animation/ink_drop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698