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

Side by Side Diff: chrome/browser/ui/event_disposition_utils.cc

Issue 6893046: added CTRL+Click and SHIFT+Click handler for context menu, Back and Forward. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: make event_utils::DispositionFromEventFlags not view-specific. Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/event_utils.h" 5 #include "chrome/browser/ui/views/event_utils.h"
6 6
7 #include "content/browser/disposition_utils.h" 7 #include "content/browser/disposition_utils.h"
8 #include "views/events/event.h" 8 #include "ui/base/events.h"
9
10 using views::Event;
11 9
12 namespace event_utils { 10 namespace event_utils {
13 11
14 WindowOpenDisposition DispositionFromEventFlags(int event_flags) { 12 WindowOpenDisposition DispositionFromEventFlags(int event_flags) {
15 return disposition_utils::DispositionFromClick( 13 return disposition_utils::DispositionFromClick(
16 (event_flags & ui::EF_MIDDLE_BUTTON_DOWN) != 0, 14 (event_flags & ui::EF_MIDDLE_BUTTON_DOWN) != 0,
17 (event_flags & ui::EF_ALT_DOWN) != 0, 15 (event_flags & ui::EF_ALT_DOWN) != 0,
18 (event_flags & ui::EF_CONTROL_DOWN) != 0, 16 (event_flags & ui::EF_CONTROL_DOWN) != 0,
19 false /* meta_key */, 17 false /* meta_key */,
20 (event_flags & ui::EF_SHIFT_DOWN) != 0); 18 (event_flags & ui::EF_SHIFT_DOWN) != 0);
21 } 19 }
22 20
23 bool IsPossibleDispositionEvent(const views::MouseEvent& event) {
24 return event.IsLeftMouseButton() || event.IsMiddleMouseButton();
25 } 21 }
26
27 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698