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

Unified Diff: chrome/browser/ui/gtk/accelerators_gtk.h

Issue 6099014: Move chrome/browser/gtk to chrome/browser/ui/gtk (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Move browser/gtk/ to browser/ui/gtk/, leave header stubs, update new header guards Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/gtk/about_chrome_dialog.cc ('k') | chrome/browser/ui/gtk/accelerators_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/gtk/accelerators_gtk.h
diff --git a/chrome/browser/ui/gtk/accelerators_gtk.h b/chrome/browser/ui/gtk/accelerators_gtk.h
new file mode 100644
index 0000000000000000000000000000000000000000..c97aef18f6efeb168f12957e141a19e2c17068eb
--- /dev/null
+++ b/chrome/browser/ui/gtk/accelerators_gtk.h
@@ -0,0 +1,45 @@
+// 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_UI_GTK_ACCELERATORS_GTK_H_
+#define CHROME_BROWSER_UI_GTK_ACCELERATORS_GTK_H_
+#pragma once
+
+#include "app/menus/accelerator_gtk.h"
+#include "base/hash_tables.h"
+
+template <typename T> struct DefaultSingletonTraits;
+
+class AcceleratorsGtk {
+ public:
+ typedef std::vector<std::pair<int, menus::AcceleratorGtk> >
+ AcceleratorGtkList;
+ typedef AcceleratorGtkList::const_iterator const_iterator;
+
+ // Returns the singleton instance.
+ static AcceleratorsGtk* GetInstance();
+
+ 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:
+ friend struct DefaultSingletonTraits<AcceleratorsGtk>;
+
+ AcceleratorsGtk();
+ ~AcceleratorsGtk();
+
+ base::hash_map<int, menus::AcceleratorGtk> primary_accelerators_;
+
+ AcceleratorGtkList all_accelerators_;
+};
+
+#endif // CHROME_BROWSER_UI_GTK_ACCELERATORS_GTK_H_
« no previous file with comments | « chrome/browser/ui/gtk/about_chrome_dialog.cc ('k') | chrome/browser/ui/gtk/accelerators_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698