OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_EVENT_LOOP_H_ | 5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_EVENT_LOOP_H_ |
6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_EVENT_LOOP_H_ | 6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_EVENT_LOOP_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/base/glib/glib_integers.h" | 9 #include "ui/base/glib/glib_integers.h" |
10 | 10 |
11 typedef union _GdkEvent GdkEvent; | 11 typedef union _GdkEvent GdkEvent; |
12 typedef struct _GdkEventKey GdkEventKey; | 12 typedef struct _GdkEventKey GdkEventKey; |
13 | 13 |
| 14 namespace base { |
14 template<typename Type> struct DefaultSingletonTraits; | 15 template<typename Type> struct DefaultSingletonTraits; |
| 16 } |
15 | 17 |
16 namespace libgtk2ui { | 18 namespace libgtk2ui { |
17 | 19 |
18 class Gtk2EventLoop { | 20 class Gtk2EventLoop { |
19 public: | 21 public: |
20 static Gtk2EventLoop* GetInstance(); | 22 static Gtk2EventLoop* GetInstance(); |
21 | 23 |
22 private: | 24 private: |
23 friend struct DefaultSingletonTraits<Gtk2EventLoop>; | 25 friend struct base::DefaultSingletonTraits<Gtk2EventLoop>; |
24 | 26 |
25 Gtk2EventLoop(); | 27 Gtk2EventLoop(); |
26 ~Gtk2EventLoop(); | 28 ~Gtk2EventLoop(); |
27 | 29 |
28 static void DispatchGdkEvent(GdkEvent* gdk_event, gpointer); | 30 static void DispatchGdkEvent(GdkEvent* gdk_event, gpointer); |
29 static void ProcessGdkEventKey(const GdkEventKey& gdk_event_key); | 31 static void ProcessGdkEventKey(const GdkEventKey& gdk_event_key); |
30 | 32 |
31 DISALLOW_COPY_AND_ASSIGN(Gtk2EventLoop); | 33 DISALLOW_COPY_AND_ASSIGN(Gtk2EventLoop); |
32 }; | 34 }; |
33 | 35 |
34 } // namespace libgtk2ui | 36 } // namespace libgtk2ui |
35 | 37 |
36 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_EVENT_LOOP_H_ | 38 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_EVENT_LOOP_H_ |
OLD | NEW |