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

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

Issue 160083003: Split cocoa_event_utils in two parts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: still works? 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 | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm » ('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"
11 #include "chrome/app/chrome_command_ids.h" 11 #include "chrome/app/chrome_command_ids.h"
12 #import "ui/base/accelerators/platform_accelerator_cocoa.h" 12 #import "ui/base/accelerators/platform_accelerator_cocoa.h"
13 #import "ui/base/cocoa/cocoa_event_utils.h" 13 #import "ui/events/cocoa/cocoa_event_utils.h"
14 #import "ui/events/keycodes/keyboard_code_conversion_mac.h" 14 #import "ui/events/keycodes/keyboard_code_conversion_mac.h"
15 15
16 namespace { 16 namespace {
17 17
18 // These accelerators are not associated with a command_id. 18 // These accelerators are not associated with a command_id.
19 const struct AcceleratorListing { 19 const struct AcceleratorListing {
20 NSUInteger modifiers; // The Cocoa modifiers. 20 NSUInteger modifiers; // The Cocoa modifiers.
21 ui::KeyboardCode key_code; // The key used for cross-platform compatibility. 21 ui::KeyboardCode key_code; // The key used for cross-platform compatibility.
22 } kAcceleratorList [] = { 22 } kAcceleratorList [] = {
23 {NSCommandKeyMask | NSAlternateKeyMask, ui::VKEY_H}, 23 {NSCommandKeyMask | NSAlternateKeyMask, ui::VKEY_H},
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 NSUInteger mask = platform_accelerator->modifier_mask(); 183 NSUInteger mask = platform_accelerator->modifier_mask();
184 BOOL maskEqual = 184 BOOL maskEqual =
185 (mask == modifiers) || ((mask & (~NSShiftKeyMask)) == modifiers); 185 (mask == modifiers) || ((mask & (~NSShiftKeyMask)) == modifiers);
186 NSString* string = [NSString stringWithFormat:@"%C", character]; 186 NSString* string = [NSString stringWithFormat:@"%C", character];
187 if ([string isEqual:key_equivalent] && maskEqual) 187 if ([string isEqual:key_equivalent] && maskEqual)
188 return &*it; 188 return &*it;
189 } 189 }
190 190
191 return NULL; 191 return NULL;
192 } 192 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698