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

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

Issue 1495753002: Make the material design ripple effect more visible on a quick action (single click or single tap) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Renamed kDurationTableInMs to kAnimationDurationInMs. Created 4 years, 10 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/test/ink_drop_animation_test_api.cc ('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/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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 UpdateInkDropHoverState(); 135 UpdateInkDropHoverState();
136 } 136 }
137 137
138 const char* CustomButton::GetClassName() const { 138 const char* CustomButton::GetClassName() const {
139 return kViewClassName; 139 return kViewClassName;
140 } 140 }
141 141
142 bool CustomButton::OnMousePressed(const ui::MouseEvent& event) { 142 bool CustomButton::OnMousePressed(const ui::MouseEvent& event) {
143 if (state_ == STATE_DISABLED) 143 if (state_ == STATE_DISABLED)
144 return true; 144 return true;
145 if (ShouldEnterPushedState(event) && HitTestPoint(event.location())) { 145 if (state_ != STATE_PRESSED && ShouldEnterPushedState(event) &&
146 HitTestPoint(event.location())) {
146 SetState(STATE_PRESSED); 147 SetState(STATE_PRESSED);
147 if (ink_drop_delegate_) 148 if (ink_drop_delegate_)
148 ink_drop_delegate_->OnAction(views::InkDropState::ACTION_PENDING); 149 ink_drop_delegate_->OnAction(views::InkDropState::ACTION_PENDING);
149 } 150 }
150 if (request_focus_on_press_) 151 if (request_focus_on_press_)
151 RequestFocus(); 152 RequestFocus();
152 if (IsTriggerableEvent(event) && notify_action_ == NOTIFY_ON_PRESS) { 153 if (IsTriggerableEvent(event) && notify_action_ == NOTIFY_ON_PRESS) {
153 NotifyClick(event); 154 NotifyClick(event);
154 // NOTE: We may be deleted at this point (by the listener's notification 155 // NOTE: We may be deleted at this point (by the listener's notification
155 // handler). 156 // handler).
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget(); 457 return GetWidget() && GetWidget()->GetTopLevelWidget() != GetWidget();
457 } 458 }
458 459
459 bool CustomButton::FocusInChildWidget() const { 460 bool CustomButton::FocusInChildWidget() const {
460 return GetWidget() && 461 return GetWidget() &&
461 GetWidget()->GetRootView()->Contains( 462 GetWidget()->GetRootView()->Contains(
462 GetFocusManager()->GetFocusedView()); 463 GetFocusManager()->GetFocusedView());
463 } 464 }
464 465
465 } // namespace views 466 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/test/ink_drop_animation_test_api.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698