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

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

Issue 22397002: ash: Process double-click event only for left-button clicks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/touch/touch_uma.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 break; 88 break;
89 case ui::ET_MOUSE_PRESSED: { 89 case ui::ET_MOUSE_PRESSED: {
90 // Maximize behavior is implemented as post-target handling so the target 90 // Maximize behavior is implemented as post-target handling so the target
91 // can cancel it. 91 // can cancel it.
92 if (ui::EventCanceledDefaultHandling(*event)) { 92 if (ui::EventCanceledDefaultHandling(*event)) {
93 ToplevelWindowEventHandler::OnMouseEvent(event); 93 ToplevelWindowEventHandler::OnMouseEvent(event);
94 return; 94 return;
95 } 95 }
96 96
97 if (event->flags() & ui::EF_IS_DOUBLE_CLICK && 97 if (event->flags() & ui::EF_IS_DOUBLE_CLICK &&
98 event->IsOnlyLeftMouseButton() &&
98 target->delegate()->GetNonClientComponent(event->location()) == 99 target->delegate()->GetNonClientComponent(event->location()) ==
99 HTCAPTION && 100 HTCAPTION &&
100 !ash::Shell::IsForcedMaximizeMode()) { 101 !ash::Shell::IsForcedMaximizeMode()) {
101 bool destroyed = false; 102 bool destroyed = false;
102 destroyed_ = &destroyed; 103 destroyed_ = &destroyed;
103 ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction( 104 ash::Shell::GetInstance()->delegate()->RecordUserMetricsAction(
104 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK); 105 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK);
105 ToggleMaximizedState(target); 106 ToggleMaximizedState(target);
106 if (destroyed) 107 if (destroyed)
107 return; 108 return;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 origin.y(), 187 origin.y(),
187 work_area.width(), 188 work_area.width(),
188 target->bounds().height())); 189 target->bounds().height()));
189 } 190 }
190 } 191 }
191 } 192 }
192 } 193 }
193 194
194 } // namespace internal 195 } // namespace internal
195 } // namespace ash 196 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_window_event_handler.cc ('k') | ash/wm/workspace/workspace_event_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698