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

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

Issue 5711001: Add a new GetInstance() method for remaining files with singleton classes under chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 10 years 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
Index: chrome/browser/gtk/accelerators_gtk.h
diff --git a/chrome/browser/gtk/accelerators_gtk.h b/chrome/browser/gtk/accelerators_gtk.h
index 1ea7ce42f466fb6eb0da711f7d89a41e103cb6e7..2e4570036bc10219e5032061686d3aa4a392fa54 100644
--- a/chrome/browser/gtk/accelerators_gtk.h
+++ b/chrome/browser/gtk/accelerators_gtk.h
@@ -9,15 +9,17 @@
#include "app/menus/accelerator_gtk.h"
#include "base/hash_tables.h"
+template <typename T> struct DefaultSingletonTraits;
+
class AcceleratorsGtk {
public:
- AcceleratorsGtk();
- ~AcceleratorsGtk();
-
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();
}
@@ -30,6 +32,11 @@ class AcceleratorsGtk {
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_;

Powered by Google App Engine
This is Rietveld 408576698