OLD | NEW |
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/gtk/bubble/bubble_accelerators_gtk.h" | 5 #include "chrome/browser/ui/gtk/bubble/bubble_accelerators_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <glib.h> | |
9 | 8 |
10 namespace { | 9 namespace { |
11 | 10 |
12 // Listing of the accelerators that are either handled or forwarded by | 11 // Listing of the accelerators that are either handled or forwarded by |
13 // bubbles. Any accelerators that are not explicitly listed here | 12 // bubbles. Any accelerators that are not explicitly listed here |
14 // are ignored and silently dropped. This table is expected to change | 13 // are ignored and silently dropped. This table is expected to change |
15 // after discussion over which accelerators should be addressed in | 14 // after discussion over which accelerators should be addressed in |
16 // bubbles. For a complete listing of accelerators that are used | 15 // bubbles. For a complete listing of accelerators that are used |
17 // in chrome consult accelerators_gtk.cc | 16 // in chrome consult accelerators_gtk.cc |
18 const BubbleAcceleratorGtk kAcceleratorMap[] = { | 17 const BubbleAcceleratorGtk kAcceleratorMap[] = { |
19 // Tab/window controls. | 18 // Tab/window controls. |
20 { GDK_w, GDK_CONTROL_MASK }, | 19 { GDK_w, GDK_CONTROL_MASK }, |
21 | 20 |
22 // Navigation / toolbar buttons. | 21 // Navigation / toolbar buttons. |
23 { GDK_Escape, GdkModifierType(0) } | 22 { GDK_Escape, GdkModifierType(0) } |
24 }; | 23 }; |
25 | 24 |
26 } // namespace | 25 } // namespace |
27 | 26 |
28 // static | 27 // static |
29 BubbleAcceleratorsGtk::const_iterator BubbleAcceleratorsGtk::begin() { | 28 BubbleAcceleratorsGtk::const_iterator BubbleAcceleratorsGtk::begin() { |
30 return &kAcceleratorMap[0]; | 29 return &kAcceleratorMap[0]; |
31 } | 30 } |
32 | 31 |
33 // static | 32 // static |
34 BubbleAcceleratorsGtk::const_iterator BubbleAcceleratorsGtk::end() { | 33 BubbleAcceleratorsGtk::const_iterator BubbleAcceleratorsGtk::end() { |
35 return &kAcceleratorMap[arraysize(kAcceleratorMap)]; | 34 return &kAcceleratorMap[arraysize(kAcceleratorMap)]; |
36 } | 35 } |
OLD | NEW |