| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIEWS_FRAME_GLOBAL_MENU_BAR_REGISTRAR_X11_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_GLOBAL_MENU_BAR_REGISTRAR_X11_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_GLOBAL_MENU_BAR_REGISTRAR_X11_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_GLOBAL_MENU_BAR_REGISTRAR_X11_H_ |
| 7 | 7 |
| 8 #include <gio/gio.h> | 8 #include <gio/gio.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // com.canonical.AppMenu.Registrar and to register/unregister the mapping | 21 // com.canonical.AppMenu.Registrar and to register/unregister the mapping |
| 22 // between a XID and the DbusmenuServer instance we are offering. | 22 // between a XID and the DbusmenuServer instance we are offering. |
| 23 class GlobalMenuBarRegistrarX11 { | 23 class GlobalMenuBarRegistrarX11 { |
| 24 public: | 24 public: |
| 25 static GlobalMenuBarRegistrarX11* GetInstance(); | 25 static GlobalMenuBarRegistrarX11* GetInstance(); |
| 26 | 26 |
| 27 void OnWindowMapped(unsigned long xid); | 27 void OnWindowMapped(unsigned long xid); |
| 28 void OnWindowUnmapped(unsigned long xid); | 28 void OnWindowUnmapped(unsigned long xid); |
| 29 | 29 |
| 30 private: | 30 private: |
| 31 friend struct DefaultSingletonTraits<GlobalMenuBarRegistrarX11>; | 31 friend struct base::DefaultSingletonTraits<GlobalMenuBarRegistrarX11>; |
| 32 | 32 |
| 33 GlobalMenuBarRegistrarX11(); | 33 GlobalMenuBarRegistrarX11(); |
| 34 ~GlobalMenuBarRegistrarX11(); | 34 ~GlobalMenuBarRegistrarX11(); |
| 35 | 35 |
| 36 // Sends the actual message. | 36 // Sends the actual message. |
| 37 void RegisterXID(unsigned long xid); | 37 void RegisterXID(unsigned long xid); |
| 38 void UnregisterXID(unsigned long xid); | 38 void UnregisterXID(unsigned long xid); |
| 39 | 39 |
| 40 CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11, void, OnProxyCreated, | 40 CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11, void, OnProxyCreated, |
| 41 GObject*, GAsyncResult*); | 41 GObject*, GAsyncResult*); |
| 42 CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11, void, OnNameOwnerChanged, | 42 CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11, void, OnNameOwnerChanged, |
| 43 GObject*, GParamSpec*); | 43 GObject*, GParamSpec*); |
| 44 | 44 |
| 45 GDBusProxy* registrar_proxy_; | 45 GDBusProxy* registrar_proxy_; |
| 46 | 46 |
| 47 // Window XIDs which want to be registered, but haven't yet been because | 47 // Window XIDs which want to be registered, but haven't yet been because |
| 48 // we're waiting for the proxy to become available. | 48 // we're waiting for the proxy to become available. |
| 49 std::set<unsigned long> live_xids_; | 49 std::set<unsigned long> live_xids_; |
| 50 | 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarRegistrarX11); | 51 DISALLOW_COPY_AND_ASSIGN(GlobalMenuBarRegistrarX11); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLOBAL_MENU_BAR_REGISTRAR_X11_H_ | 54 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_GLOBAL_MENU_BAR_REGISTRAR_X11_H_ |
| OLD | NEW |