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

Side by Side Diff: chrome/browser/ui/cocoa/accelerators_cocoa.mm

Issue 154083008: Remove Tabpose feature on mac, and supporting infrastructure (PaintAtSize) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, merge Created 6 years, 10 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
« no previous file with comments | « chrome/browser/ui/browser_window.h ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/cocoa/accelerators_cocoa.h" 5 #include "chrome/browser/ui/cocoa/accelerators_cocoa.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 {IDC_PRESENTATION_MODE, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_F}, 88 {IDC_PRESENTATION_MODE, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_F},
89 {IDC_ZOOM_NORMAL, NSCommandKeyMask, ui::VKEY_0}, 89 {IDC_ZOOM_NORMAL, NSCommandKeyMask, ui::VKEY_0},
90 {IDC_HOME, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_H}, 90 {IDC_HOME, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_H},
91 {IDC_BACK, NSCommandKeyMask, ui::VKEY_OEM_4}, 91 {IDC_BACK, NSCommandKeyMask, ui::VKEY_OEM_4},
92 {IDC_FORWARD, NSCommandKeyMask, ui::VKEY_OEM_6}, 92 {IDC_FORWARD, NSCommandKeyMask, ui::VKEY_OEM_6},
93 {IDC_BOOKMARK_ALL_TABS, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_D}, 93 {IDC_BOOKMARK_ALL_TABS, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_D},
94 {IDC_MINIMIZE_WINDOW, NSCommandKeyMask, ui::VKEY_M}, 94 {IDC_MINIMIZE_WINDOW, NSCommandKeyMask, ui::VKEY_M},
95 {IDC_SELECT_NEXT_TAB, NSCommandKeyMask | NSAlternateKeyMask, ui::VKEY_RIGHT}, 95 {IDC_SELECT_NEXT_TAB, NSCommandKeyMask | NSAlternateKeyMask, ui::VKEY_RIGHT},
96 {IDC_SELECT_PREVIOUS_TAB, NSCommandKeyMask | NSAlternateKeyMask, 96 {IDC_SELECT_PREVIOUS_TAB, NSCommandKeyMask | NSAlternateKeyMask,
97 ui::VKEY_LEFT}, 97 ui::VKEY_LEFT},
98 {IDC_TABPOSE, NSCommandKeyMask | NSControlKeyMask, ui::VKEY_T},
99 {IDC_HELP_PAGE_VIA_MENU, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_OEM_2}, 98 {IDC_HELP_PAGE_VIA_MENU, NSCommandKeyMask | NSShiftKeyMask, ui::VKEY_OEM_2},
100 }; 99 };
101 100
102 // Create a Cocoa platform accelerator given a cross platform |key_code| and 101 // Create a Cocoa platform accelerator given a cross platform |key_code| and
103 // the |cocoa_modifiers|. 102 // the |cocoa_modifiers|.
104 scoped_ptr<ui::PlatformAccelerator> PlatformAcceleratorFromKeyCode( 103 scoped_ptr<ui::PlatformAccelerator> PlatformAcceleratorFromKeyCode(
105 ui::KeyboardCode key_code, 104 ui::KeyboardCode key_code,
106 NSUInteger cocoa_modifiers) { 105 NSUInteger cocoa_modifiers) {
107 unichar character; 106 unichar character;
108 unichar char_no_modifiers; 107 unichar char_no_modifiers;
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 NSUInteger mask = platform_accelerator->modifier_mask(); 183 NSUInteger mask = platform_accelerator->modifier_mask();
185 BOOL maskEqual = 184 BOOL maskEqual =
186 (mask == modifiers) || ((mask & (~NSShiftKeyMask)) == modifiers); 185 (mask == modifiers) || ((mask & (~NSShiftKeyMask)) == modifiers);
187 NSString* string = [NSString stringWithFormat:@"%C", character]; 186 NSString* string = [NSString stringWithFormat:@"%C", character];
188 if ([string isEqual:key_equivalent] && maskEqual) 187 if ([string isEqual:key_equivalent] && maskEqual)
189 return &*it; 188 return &*it;
190 } 189 }
191 190
192 return NULL; 191 return NULL;
193 } 192 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_window.h ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698