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

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: ifdefs removed Created 7 years, 5 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 if (event->details().tap_count() == 2) {
126 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE); 126 ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(
127 ToggleMaximizedState(target); // |this| may be destroyed from here. 127 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_GESTURE);
128 event->StopPropagation(); 128 // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice each time
129 return; 129 // TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP is counted once.
130 TouchUMA::GetInstance()->RecordGestureAction(
131 TouchUMA::GESTURE_MAXIMIZE_DOUBLETAP);
132 ToggleMaximizedState(target); // |this| may be destroyed from here.
133 event->StopPropagation();
134 return;
135 } else {
136 // Note: TouchUMA::GESTURE_FRAMEVIEW_TAP is counted twice for each tap.
137 TouchUMA::GetInstance()->RecordGestureAction(
138 TouchUMA::GESTURE_FRAMEVIEW_TAP);
139 }
130 } 140 }
131 ToplevelWindowEventHandler::OnGestureEvent(event); 141 ToplevelWindowEventHandler::OnGestureEvent(event);
132 } 142 }
133 143
134 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick( 144 void WorkspaceEventHandler::HandleVerticalResizeDoubleClick(
135 aura::Window* target, 145 aura::Window* target,
136 ui::MouseEvent* event) { 146 ui::MouseEvent* event) {
137 gfx::Rect max_size(target->delegate()->GetMaximumSize()); 147 gfx::Rect max_size(target->delegate()->GetMaximumSize());
138 if (event->flags() & ui::EF_IS_DOUBLE_CLICK && 148 if (event->flags() & ui::EF_IS_DOUBLE_CLICK &&
139 !wm::IsWindowMaximized(target)) { 149 !wm::IsWindowMaximized(target)) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 origin.y(), 186 origin.y(),
177 work_area.width(), 187 work_area.width(),
178 target->bounds().height())); 188 target->bounds().height()));
179 } 189 }
180 } 190 }
181 } 191 }
182 } 192 }
183 193
184 } // namespace internal 194 } // namespace internal
185 } // namespace ash 195 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698