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

Unified Diff: chrome/browser/cocoa/event_utils.mm

Issue 172082: Create new event_utils.h file for Cocoa-specific event to WindowOpenDispositi... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/event_utils.h ('k') | chrome/browser/cocoa/event_utils_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/event_utils.mm
===================================================================
--- chrome/browser/cocoa/event_utils.mm (revision 0)
+++ chrome/browser/cocoa/event_utils.mm (revision 0)
@@ -0,0 +1,16 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/cocoa/event_utils.h"
+
+namespace event_utils {
+
+WindowOpenDisposition WindowOpenDispositionFromNSEvent(NSEvent* event) {
+ NSUInteger modifiers = [event modifierFlags];
+ if ([event buttonNumber] == 2 || modifiers & NSCommandKeyMask)
+ return modifiers & NSShiftKeyMask ? NEW_FOREGROUND_TAB : NEW_BACKGROUND_TAB;
+ return modifiers & NSShiftKeyMask ? NEW_WINDOW : CURRENT_TAB;
+}
+
+} // namespace event_utils
Property changes on: chrome/browser/cocoa/event_utils.mm
___________________________________________________________________
Name: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/cocoa/event_utils.h ('k') | chrome/browser/cocoa/event_utils_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698