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 #include "chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h" | 5 #include "chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/leak_annotations.h" | 8 #include "base/debug/leak_annotations.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "chrome/browser/ui/views/frame/global_menu_bar_x11.h" | 10 #include "chrome/browser/ui/views/frame/global_menu_bar_x11.h" |
11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
12 | 12 |
13 using content::BrowserThread; | 13 using content::BrowserThread; |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 const char kAppMenuRegistrarName[] = "com.canonical.AppMenu.Registrar"; | 17 const char kAppMenuRegistrarName[] = "com.canonical.AppMenu.Registrar"; |
18 const char kAppMenuRegistrarPath[] = "/com/canonical/AppMenu/Registrar"; | 18 const char kAppMenuRegistrarPath[] = "/com/canonical/AppMenu/Registrar"; |
19 | 19 |
20 } // namespace | 20 } // namespace |
21 | 21 |
22 // static | 22 // static |
23 GlobalMenuBarRegistrarX11* GlobalMenuBarRegistrarX11::GetInstance() { | 23 GlobalMenuBarRegistrarX11* GlobalMenuBarRegistrarX11::GetInstance() { |
24 return Singleton<GlobalMenuBarRegistrarX11>::get(); | 24 return base::Singleton<GlobalMenuBarRegistrarX11>::get(); |
25 } | 25 } |
26 | 26 |
27 void GlobalMenuBarRegistrarX11::OnWindowMapped(unsigned long xid) { | 27 void GlobalMenuBarRegistrarX11::OnWindowMapped(unsigned long xid) { |
28 live_xids_.insert(xid); | 28 live_xids_.insert(xid); |
29 | 29 |
30 if (registrar_proxy_) | 30 if (registrar_proxy_) |
31 RegisterXID(xid); | 31 RegisterXID(xid); |
32 } | 32 } |
33 | 33 |
34 void GlobalMenuBarRegistrarX11::OnWindowUnmapped(unsigned long xid) { | 34 void GlobalMenuBarRegistrarX11::OnWindowUnmapped(unsigned long xid) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 void GlobalMenuBarRegistrarX11::OnNameOwnerChanged(GObject* /* ignored */, | 134 void GlobalMenuBarRegistrarX11::OnNameOwnerChanged(GObject* /* ignored */, |
135 GParamSpec* /* ignored */) { | 135 GParamSpec* /* ignored */) { |
136 // If the name owner changed, we need to reregister all the live xids with | 136 // If the name owner changed, we need to reregister all the live xids with |
137 // the system. | 137 // the system. |
138 for (std::set<unsigned long>::const_iterator it = live_xids_.begin(); | 138 for (std::set<unsigned long>::const_iterator it = live_xids_.begin(); |
139 it != live_xids_.end(); ++it) { | 139 it != live_xids_.end(); ++it) { |
140 RegisterXID(*it); | 140 RegisterXID(*it); |
141 } | 141 } |
142 } | 142 } |
OLD | NEW |