summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/accelerators_gtk.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 17:52:42 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-19 17:52:42 +0000
commit4762a9ed08ec93918b58269c21f78df72bc4961e (patch)
tree54d16d9220f4d075e14f9f2e5e32fbc4470c4d3d /chrome/browser/gtk/accelerators_gtk.h
parent0137991d3c78ec95d6d7fc386ae151d4359b308c (diff)
downloadchromium_src-4762a9ed08ec93918b58269c21f78df72bc4961e.zip
chromium_src-4762a9ed08ec93918b58269c21f78df72bc4961e.tar.gz
chromium_src-4762a9ed08ec93918b58269c21f78df72bc4961e.tar.bz2
Make a MenuModel for the popup favicon menu. For now only GTK uses it. Consolidate all accelerators for browser commands into one place.
BUG=28212,27535 TEST=1. enable custom frame and a popup window and test that the popup contains all the same (non-system) menu items as windows. 2. all context menus still display the correct shortcuts and the shortcuts work Review URL: http://codereview.chromium.org/551032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/accelerators_gtk.h')
-rw-r--r--chrome/browser/gtk/accelerators_gtk.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/chrome/browser/gtk/accelerators_gtk.h b/chrome/browser/gtk/accelerators_gtk.h
new file mode 100644
index 0000000..677caea
--- /dev/null
+++ b/chrome/browser/gtk/accelerators_gtk.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_GTK_ACCELERATORS_GTK_H_
+#define CHROME_BROWSER_GTK_ACCELERATORS_GTK_H_
+
+#include "app/menus/accelerator_gtk.h"
+#include "base/hash_tables.h"
+
+class AcceleratorsGtk {
+ public:
+ AcceleratorsGtk();
+ ~AcceleratorsGtk() { }
+
+ typedef std::vector<std::pair<int, menus::AcceleratorGtk> >
+ AcceleratorGtkList;
+ typedef AcceleratorGtkList::const_iterator const_iterator;
+
+ const_iterator const begin() {
+ return all_accelerators_.begin();
+ }
+
+ const_iterator const end() {
+ return all_accelerators_.end();
+ }
+
+ // Returns NULL if there is no accelerator for the command.
+ const menus::AcceleratorGtk* GetPrimaryAcceleratorForCommand(int command_id);
+
+ private:
+ base::hash_map<int, menus::AcceleratorGtk> primary_accelerators_;
+
+ AcceleratorGtkList all_accelerators_;
+};
+
+#endif // CHROME_BROWSER_GTK_ACCELERATORS_GTK_H_