Update to Chrome47 version of GlobalMenuBarRegistrarX11
authorPaul Betts <paul@paulbetts.org>
Mon, 7 Dec 2015 22:25:52 +0000 (14:25 -0800)
committerPaul Betts <paul@paulbetts.org>
Mon, 7 Dec 2015 22:25:52 +0000 (14:25 -0800)
chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.cc
chromium_src/chrome/browser/ui/views/frame/global_menu_bar_registrar_x11.h

index 0d2a6dd..3913325 100644 (file)
@@ -21,7 +21,7 @@ const char kAppMenuRegistrarPath[] = "/com/canonical/AppMenu/Registrar";
 
 // static
 GlobalMenuBarRegistrarX11* GlobalMenuBarRegistrarX11::GetInstance() {
-  return Singleton<GlobalMenuBarRegistrarX11>::get();
+  return base::Singleton<GlobalMenuBarRegistrarX11>::get();
 }
 
 void GlobalMenuBarRegistrarX11::OnWindowMapped(unsigned long xid) {
@@ -39,7 +39,7 @@ void GlobalMenuBarRegistrarX11::OnWindowUnmapped(unsigned long xid) {
 }
 
 GlobalMenuBarRegistrarX11::GlobalMenuBarRegistrarX11()
-    : registrar_proxy_(NULL) {
+    : registrar_proxy_(nullptr) {
   // libdbusmenu uses the gio version of dbus; I tried using the code in dbus/,
   // but it looks like that's isn't sharing the bus name with the gio version,
   // even when |connection_type| is set to SHARED.
@@ -49,11 +49,11 @@ GlobalMenuBarRegistrarX11::GlobalMenuBarRegistrarX11()
           G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES |
           G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
           G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START),
-      NULL,
+      nullptr,
       kAppMenuRegistrarName,
       kAppMenuRegistrarPath,
       kAppMenuRegistrarName,
-      NULL,  // TODO: Probalby want a real cancelable.
+      nullptr,  // TODO: Probalby want a real cancelable.
       static_cast<GAsyncReadyCallback>(OnProxyCreatedThunk),
       this);
 }
@@ -70,7 +70,7 @@ GlobalMenuBarRegistrarX11::~GlobalMenuBarRegistrarX11() {
 
 void GlobalMenuBarRegistrarX11::RegisterXID(unsigned long xid) {
   DCHECK(registrar_proxy_);
-  std::string path = atom::GlobalMenuBarX11::GetPathForWindow(xid);
+  std::string path = GlobalMenuBarX11::GetPathForWindow(xid);
 
   ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
   // TODO(erg): The mozilla implementation goes to a lot of callback trouble
@@ -84,14 +84,14 @@ void GlobalMenuBarRegistrarX11::RegisterXID(unsigned long xid) {
                     "RegisterWindow",
                     g_variant_new("(uo)", xid, path.c_str()),
                     G_DBUS_CALL_FLAGS_NONE, -1,
-                    NULL,
-                    NULL,
-                    NULL);
+                    nullptr,
+                    nullptr,
+                    nullptr);
 }
 
 void GlobalMenuBarRegistrarX11::UnregisterXID(unsigned long xid) {
   DCHECK(registrar_proxy_);
-  std::string path = atom::GlobalMenuBarX11::GetPathForWindow(xid);
+  std::string path = GlobalMenuBarX11::GetPathForWindow(xid);
 
   ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/314087
   // TODO(erg): The mozilla implementation goes to a lot of callback trouble
@@ -105,14 +105,14 @@ void GlobalMenuBarRegistrarX11::UnregisterXID(unsigned long xid) {
                     "UnregisterWindow",
                     g_variant_new("(u)", xid),
                     G_DBUS_CALL_FLAGS_NONE, -1,
-                    NULL,
-                    NULL,
-                    NULL);
+                    nullptr,
+                    nullptr,
+                    nullptr);
 }
 
 void GlobalMenuBarRegistrarX11::OnProxyCreated(GObject* source,
                                                GAsyncResult* result) {
-  GError* error = NULL;
+  GError* error = nullptr;
   GDBusProxy* proxy = g_dbus_proxy_new_for_bus_finish(result, &error);
   if (error) {
     g_error_free(error);
@@ -128,7 +128,7 @@ void GlobalMenuBarRegistrarX11::OnProxyCreated(GObject* source,
   g_signal_connect(registrar_proxy_, "notify::g-name-owner",
                    G_CALLBACK(OnNameOwnerChangedThunk), this);
 
-  OnNameOwnerChanged(NULL, NULL);
+  OnNameOwnerChanged(nullptr, nullptr);
 }
 
 void GlobalMenuBarRegistrarX11::OnNameOwnerChanged(GObject* /* ignored */,
index e35e87c..694f776 100644 (file)
@@ -28,7 +28,7 @@ class GlobalMenuBarRegistrarX11 {
   void OnWindowUnmapped(unsigned long xid);
 
  private:
-  friend struct DefaultSingletonTraits<GlobalMenuBarRegistrarX11>;
+  friend struct base::DefaultSingletonTraits<GlobalMenuBarRegistrarX11>;
 
   GlobalMenuBarRegistrarX11();
   ~GlobalMenuBarRegistrarX11();