OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/accelerators_gtk.h" | 5 #include "chrome/browser/gtk/accelerators_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <X11/XF86keysym.h> | 9 #include <X11/XF86keysym.h> |
10 | 10 |
11 #include "chrome/app/chrome_dll_resource.h" | 11 #include "chrome/app/chrome_command_ids.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // A mostly complete list of chrome's accelerators. When one command has | 15 // A mostly complete list of chrome's accelerators. When one command has |
16 // multiple shortcuts, the first one in this list is considered "primary", | 16 // multiple shortcuts, the first one in this list is considered "primary", |
17 // meaning that it will be displayed in context menus. | 17 // meaning that it will be displayed in context menus. |
18 const struct AcceleratorMapping { | 18 const struct AcceleratorMapping { |
19 guint keyval; | 19 guint keyval; |
20 int command_id; | 20 int command_id; |
21 GdkModifierType modifier_type; | 21 GdkModifierType modifier_type; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 const menus::AcceleratorGtk* AcceleratorsGtk::GetPrimaryAcceleratorForCommand( | 193 const menus::AcceleratorGtk* AcceleratorsGtk::GetPrimaryAcceleratorForCommand( |
194 int command_id) { | 194 int command_id) { |
195 base::hash_map<int, menus::AcceleratorGtk>::const_iterator iter = | 195 base::hash_map<int, menus::AcceleratorGtk>::const_iterator iter = |
196 primary_accelerators_.find(command_id); | 196 primary_accelerators_.find(command_id); |
197 | 197 |
198 if (iter == primary_accelerators_.end()) | 198 if (iter == primary_accelerators_.end()) |
199 return NULL; | 199 return NULL; |
200 | 200 |
201 return &iter->second; | 201 return &iter->second; |
202 } | 202 } |
OLD | NEW |