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

Unified Diff: ash/wm/panels/panel_window_event_handler.cc

Issue 139983009: ui::LocatedEvent location() returns gfx::PointF (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo accidental change. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/panels/panel_window_event_handler.cc
diff --git a/ash/wm/panels/panel_window_event_handler.cc b/ash/wm/panels/panel_window_event_handler.cc
index 006c5d89ef7a7d8e4e1c1f7a6cdaa3829952dc25..bc2661d9c899b0fe6fdb91b467f4256543942ceb 100644
--- a/ash/wm/panels/panel_window_event_handler.cc
+++ b/ash/wm/panels/panel_window_event_handler.cc
@@ -22,12 +22,11 @@ PanelWindowEventHandler::~PanelWindowEventHandler() {
void PanelWindowEventHandler::OnMouseEvent(ui::MouseEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
- if (!event->handled() &&
- event->type() == ui::ET_MOUSE_PRESSED &&
+ if (!event->handled() && event->type() == ui::ET_MOUSE_PRESSED &&
event->flags() & ui::EF_IS_DOUBLE_CLICK &&
event->IsOnlyLeftMouseButton() &&
- target->delegate()->GetNonClientComponent(event->location()) ==
- HTCAPTION) {
+ target->delegate()->GetNonClientComponent(
+ gfx::ToFlooredPoint(event->location())) == HTCAPTION) {
ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction(
ash::UMA_PANEL_MINIMIZE_CAPTION_CLICK);
wm::GetWindowState(target)->Minimize();
@@ -38,11 +37,10 @@ void PanelWindowEventHandler::OnMouseEvent(ui::MouseEvent* event) {
void PanelWindowEventHandler::OnGestureEvent(ui::GestureEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
- if (!event->handled() &&
- event->type() == ui::ET_GESTURE_TAP &&
+ if (!event->handled() && event->type() == ui::ET_GESTURE_TAP &&
event->details().tap_count() == 2 &&
- target->delegate()->GetNonClientComponent(event->location()) ==
- HTCAPTION) {
+ target->delegate()->GetNonClientComponent(
+ gfx::ToFlooredPoint(event->location())) == HTCAPTION) {
ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction(
ash::UMA_PANEL_MINIMIZE_CAPTION_GESTURE);
wm::GetWindowState(target)->Minimize();

Powered by Google App Engine
This is Rietveld 408576698