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

Side by Side Diff: chrome/browser/global_keyboard_shortcuts_mac.mm

Issue 155252: Remove errant semicolon. distcc's pump mode didn't understand this. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/global_keyboard_shortcuts_mac.h" 5 #include "chrome/browser/global_keyboard_shortcuts_mac.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "chrome/app/chrome_dll_resource.h" 8 #include "chrome/app/chrome_dll_resource.h"
9 9
10 const KeyboardShortcutData* GetKeyboardShortCutTable(size_t* num_entries) { 10 const KeyboardShortcutData* GetKeyboardShortCutTable(size_t* num_entries) {
11 static const KeyboardShortcutData keyboard_shortcuts[] = { 11 static const KeyboardShortcutData keyboard_shortcuts[] = {
12 {true, true, false, 30 /* ] */, IDC_SELECT_NEXT_TAB}, 12 {true, true, false, 30 /* ] */, IDC_SELECT_NEXT_TAB},
13 {false, false, true, 121 /* pg down */, IDC_SELECT_NEXT_TAB}, 13 {false, false, true, 121 /* pg down */, IDC_SELECT_NEXT_TAB},
14 {true, true, false, 33 /* [ */, IDC_SELECT_PREVIOUS_TAB}, 14 {true, true, false, 33 /* [ */, IDC_SELECT_PREVIOUS_TAB},
15 {false, false, true, 116 /* pg_up */, IDC_SELECT_PREVIOUS_TAB}, 15 {false, false, true, 116 /* pg_up */, IDC_SELECT_PREVIOUS_TAB},
16 }; 16 };
17 17
18 *num_entries = arraysize(keyboard_shortcuts); 18 *num_entries = arraysize(keyboard_shortcuts);
19 19
20 return keyboard_shortcuts; 20 return keyboard_shortcuts;
21 } 21 }
22 22
23 int CommandForKeyboardShortcut(bool command_key, bool shift_key, bool cntrl_key, 23 int CommandForKeyboardShortcut(bool command_key, bool shift_key, bool cntrl_key,
24 int vkey_code) { 24 int vkey_code) {
25 25
26 // Scan through keycodes and see if it corresponds to one of the global 26 // Scan through keycodes and see if it corresponds to one of the global
27 // shortcuts on file. 27 // shortcuts on file.
28 // 28 //
29 // TODO(jeremy): Change this into a hash table once we get enough 29 // TODO(jeremy): Change this into a hash table once we get enough
30 // entries in the array to make a difference. 30 // entries in the array to make a difference.
31 size_t num_shortcuts = 0; 31 size_t num_shortcuts = 0;
32 const KeyboardShortcutData *it = GetKeyboardShortCutTable(&num_shortcuts); 32 const KeyboardShortcutData *it = GetKeyboardShortCutTable(&num_shortcuts);
33 for (size_t i = 0; i < num_shortcuts; ++i, ++it) { 33 for (size_t i = 0; i < num_shortcuts; ++i, ++it) {
34 if (it->command_key == command_key && 34 if (it->command_key == command_key &&
35 it->shift_key == shift_key && 35 it->shift_key == shift_key &&
36 it->cntrl_key == cntrl_key && 36 it->cntrl_key == cntrl_key &&
37 it->vkey_code == vkey_code) { 37 it->vkey_code == vkey_code) {
38 return it->chrome_command; 38 return it->chrome_command;
39 } 39 }
40 } 40 }
41 41
42 return -1; 42 return -1;
43 } 43 }
OLDNEW
« no previous file with comments | « chrome/browser/global_keyboard_shortcuts_mac.h ('k') | chrome/browser/global_keyboard_shortcuts_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698