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

Side by Side Diff: chrome/browser/ui/views/toolbar/toolbar_button.cc

Issue 1373983002: Enhanced the InkDropRippleImpl to create/destroy InkDropAnimations as needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed merge with master. Created 5 years, 2 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 | « no previous file | ui/views/animation/ink_drop_animation.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/views/toolbar/toolbar_button.h" 5 #include "chrome/browser/ui/views/toolbar/toolbar_button.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 void ToolbarButton::OnMouseReleased(const ui::MouseEvent& event) { 138 void ToolbarButton::OnMouseReleased(const ui::MouseEvent& event) {
139 if (IsTriggerableEvent(event) || 139 if (IsTriggerableEvent(event) ||
140 (event.IsRightMouseButton() && !HitTestPoint(event.location()))) { 140 (event.IsRightMouseButton() && !HitTestPoint(event.location()))) {
141 LabelButton::OnMouseReleased(event); 141 LabelButton::OnMouseReleased(event);
142 } 142 }
143 143
144 if (IsTriggerableEvent(event)) 144 if (IsTriggerableEvent(event))
145 show_menu_factory_.InvalidateWeakPtrs(); 145 show_menu_factory_.InvalidateWeakPtrs();
146 146
147 ink_drop_animation_controller_->AnimateToState(views::InkDropState::HIDDEN); 147 if (!HitTestPoint(event.location()))
148 ink_drop_animation_controller_->AnimateToState(views::InkDropState::HIDDEN);
148 } 149 }
149 150
150 void ToolbarButton::OnMouseCaptureLost() { 151 void ToolbarButton::OnMouseCaptureLost() {
151 } 152 }
152 153
153 void ToolbarButton::OnMouseExited(const ui::MouseEvent& event) { 154 void ToolbarButton::OnMouseExited(const ui::MouseEvent& event) {
154 // Starting a drag results in a MouseExited, we need to ignore it. 155 // Starting a drag results in a MouseExited, we need to ignore it.
155 // A right click release triggers an exit event. We want to 156 // A right click release triggers an exit event. We want to
156 // remain in a PUSHED state until the drop down menu closes. 157 // remain in a PUSHED state until the drop down menu closes.
157 if (state_ != STATE_DISABLED && !InDrag() && state_ != STATE_PRESSED) 158 if (state_ != STATE_DISABLED && !InDrag() && state_ != STATE_PRESSED)
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 SetState(STATE_NORMAL); 342 SetState(STATE_NORMAL);
342 } 343 }
343 344
344 gfx::Point ToolbarButton::CalculateInkDropCenter() const { 345 gfx::Point ToolbarButton::CalculateInkDropCenter() const {
345 return GetLocalBounds().CenterPoint(); 346 return GetLocalBounds().CenterPoint();
346 } 347 }
347 348
348 const char* ToolbarButton::GetClassName() const { 349 const char* ToolbarButton::GetClassName() const {
349 return "ToolbarButton"; 350 return "ToolbarButton";
350 } 351 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698