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

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

Issue 16832003: Add UMA metrics to measure the effectiveness of views fuzzing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments addressed Created 7 years, 6 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/screen_ash.h" 7 #include "ash/screen_ash.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_delegate.h" 9 #include "ash/shell_delegate.h"
10 #include "ash/touch/touch_uma.h"
10 #include "ash/wm/coordinate_conversion.h" 11 #include "ash/wm/coordinate_conversion.h"
11 #include "ash/wm/property_util.h" 12 #include "ash/wm/property_util.h"
12 #include "ash/wm/window_util.h" 13 #include "ash/wm/window_util.h"
13 #include "ash/wm/workspace/workspace_window_resizer.h" 14 #include "ash/wm/workspace/workspace_window_resizer.h"
14 #include "ui/aura/client/aura_constants.h" 15 #include "ui/aura/client/aura_constants.h"
15 #include "ui/aura/window.h" 16 #include "ui/aura/window.h"
16 #include "ui/aura/window_delegate.h" 17 #include "ui/aura/window_delegate.h"
17 #include "ui/base/events/event.h" 18 #include "ui/base/events/event.h"
18 #include "ui/base/events/event_utils.h" 19 #include "ui/base/events/event_utils.h"
19 #include "ui/base/hit_test.h" 20 #include "ui/base/hit_test.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 113 }
113 default: 114 default:
114 break; 115 break;
115 } 116 }
116 ToplevelWindowEventHandler::OnMouseEvent(event); 117 ToplevelWindowEventHandler::OnMouseEvent(event);
117 } 118 }
118 119
119 void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) { 120 void WorkspaceEventHandler::OnGestureEvent(ui::GestureEvent* event) {
120 aura::Window* target = static_cast<aura::Window*>(event->target()); 121 aura::Window* target = static_cast<aura::Window*>(event->target());
121 if (event->type() == ui::ET_GESTURE_TAP && 122 if (event->type() == ui::ET_GESTURE_TAP &&
122 event->details().tap_count() == 2 &&
123 target->delegate()->GetNonClientComponent(event->location()) == 123 target->delegate()->GetNonClientComponent(event->location()) ==
124 HTCAPTION) { 124 HTCAPTION) {
125 ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( 125 // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice for each tap.
126 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE); 126 TouchUMA::GetInstance()->RecordGestureAction(
127 ToggleMaximizedState(target); // |this| may be destroyed from here. 127 TouchUMA::GESTURE_FRAMEVIEW_TAP);
128 event->StopPropagation(); 128
129 return; 129 if (event->details().tap_count() == 2) {
130 ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(
131 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE);
132 TouchUMA::GetInstance()->RecordGestureAction(
133 TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP);
134 ToggleMaximizedState(target); // |this| may be destroyed from here.
135 event->StopPropagation();
136 return;
137 }
130 } 138 }
131 ToplevelWindowEventHandler::OnGestureEvent(event); 139 ToplevelWindowEventHandler::OnGestureEvent(event);
132 } 140 }
133 141
134 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( 142 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick(
135 aura::Window* target, 143 aura::Window* target,
136 ui::MouseEvent* event) { 144 ui::MouseEvent* event) {
137 gfx::Rect max_size(target->delegate()->GetMaximumSize()); 145 gfx::Rect max_size(target->delegate()->GetMaximumSize());
138 if (event->flags() & ui::EF_IS_DOUBLE_CLICK && 146 if (event->flags() & ui::EF_IS_DOUBLE_CLICK &&
139 !wm::IsWindowMaximized(target)) { 147 !wm::IsWindowMaximized(target)) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 origin.y(), 184 origin.y(),
177 work_area.width(), 185 work_area.width(),
178 target->bounds().height())); 186 target->bounds().height()));
179 } 187 }
180 } 188 }
181 } 189 }
182 } 190 }
183 191
184 } // namespace internal 192 } // namespace internal
185 } // namespace ash 193 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698