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

Side by Side Diff: ash/wm/workspace/workspace_event_handler.cc

Issue 144193002: Only drag or maximize / restore when event has not yet been handled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Panels too, no test for these yet. Created 6 years, 11 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 | Annotate | Revision Log
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 "ash/wm/workspace/workspace_event_handler.h" 5 #include "ash/wm/workspace/workspace_event_handler.h"
6 6
7 #include "ash/metrics/user_metrics_recorder.h" 7 #include "ash/metrics/user_metrics_recorder.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/touch/touch_uma.h" 9 #include "ash/touch/touch_uma.h"
10 #include "ash/wm/coordinate_conversion.h" 10 #include "ash/wm/coordinate_conversion.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 namespace internal { 54 namespace internal {
55 55
56 WorkspaceEventHandler::WorkspaceEventHandler() { 56 WorkspaceEventHandler::WorkspaceEventHandler() {
57 } 57 }
58 58
59 WorkspaceEventHandler::~WorkspaceEventHandler() { 59 WorkspaceEventHandler::~WorkspaceEventHandler() {
60 } 60 }
61 61
62 void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { 62 void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) {
63 if (event->handled())
64 return;
63 aura::Window* target = static_cast<aura::Window*>(event->target()); 65 aura::Window* target = static_cast<aura::Window*>(event->target());
64 switch (event->type()) { 66 switch (event->type()) {
65 case ui::ET_MOUSE_MOVED: { 67 case ui::ET_MOUSE_MOVED: {
66 int component = 68 int component =
67 target->delegate()->GetNonClientComponent(event->location()); 69 target->delegate()->GetNonClientComponent(event->location());
68 multi_window_resize_controller_.Show(target, component, 70 multi_window_resize_controller_.Show(target, component,
69 event->location()); 71 event->location());
70 break; 72 break;
71 } 73 }
72 case ui::ET_MOUSE_ENTERED: 74 case ui::ET_MOUSE_ENTERED:
(...skipping 15 matching lines...) Expand all
88 multi_window_resize_controller_.Hide(); 90 multi_window_resize_controller_.Hide();
89 HandleVerticalResizeDoubleClick(target_state, event); 91 HandleVerticalResizeDoubleClick(target_state, event);
90 break; 92 break;
91 } 93 }
92 default: 94 default:
93 break; 95 break;
94 } 96 }
95 } 97 }
96 98
97 void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) { 99 void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) {
100 if (event->handled())
101 return;
98 aura::Window* target = static_cast<aura::Window*>(event->target()); 102 aura::Window* target = static_cast<aura::Window*>(event->target());
99 if (event->type() == ui::ET_GESTURE_TAP && 103 if (event->type() == ui::ET_GESTURE_TAP &&
100 target->delegate()->GetNonClientComponent(event->location()) == 104 target->delegate()->GetNonClientComponent(event->location()) ==
101 HTCAPTION) { 105 HTCAPTION) {
102 if (event->details().tap_count() == 2) { 106 if (event->details().tap_count() == 2) {
103 ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( 107 ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction(
104 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE); 108 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE);
105 // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice each time 109 // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice each time
106 // TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP is counted once. 110 // TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP is counted once.
107 TouchUMA::GetInstance()->RecordGestureAction( 111 TouchUMA::GetInstance()->RecordGestureAction(
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 work_area.width(), 168 work_area.width(),
165 target->bounds().height())); 169 target->bounds().height()));
166 } 170 }
167 event->StopPropagation(); 171 event->StopPropagation();
168 } 172 }
169 } 173 }
170 } 174 }
171 175
172 } // namespace internal 176 } // namespace internal
173 } // namespace ash 177 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698