From 497174bbe4eb518629d5b0660f5c5c8e259223e2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 11 Jul 2014 09:18:06 +0800 Subject: [PATCH] linux: Avoid using unsigned long directly. --- atom/browser/ui/views/global_menu_bar_x11.cc | 4 ++-- atom/browser/ui/views/global_menu_bar_x11.h | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/atom/browser/ui/views/global_menu_bar_x11.cc b/atom/browser/ui/views/global_menu_bar_x11.cc index 5ebd79bdb274..eeecb2a1735f 100644 --- a/atom/browser/ui/views/global_menu_bar_x11.cc +++ b/atom/browser/ui/views/global_menu_bar_x11.cc @@ -178,7 +178,7 @@ GlobalMenuBarX11::~GlobalMenuBarX11() { } // static -std::string GlobalMenuBarX11::GetPathForWindow(unsigned long xid) { +std::string GlobalMenuBarX11::GetPathForWindow(gfx::AcceleratedWidget xid) { return base::StringPrintf("/com/canonical/menu/%lX", xid); } @@ -195,7 +195,7 @@ void GlobalMenuBarX11::SetMenu(ui::MenuModel* menu_model) { g_object_unref(root_item); } -void GlobalMenuBarX11::InitServer(unsigned long xid) { +void GlobalMenuBarX11::InitServer(gfx::AcceleratedWidget xid) { std::string path = GetPathForWindow(xid); server_ = server_new(path.c_str()); } diff --git a/atom/browser/ui/views/global_menu_bar_x11.h b/atom/browser/ui/views/global_menu_bar_x11.h index 2416e02d7874..a3ff7cb86da4 100644 --- a/atom/browser/ui/views/global_menu_bar_x11.h +++ b/atom/browser/ui/views/global_menu_bar_x11.h @@ -10,6 +10,7 @@ #include "base/basictypes.h" #include "base/compiler_specific.h" #include "ui/base/glib/glib_signal.h" +#include "ui/gfx/native_widget_types.h" typedef struct _DbusmenuMenuitem DbusmenuMenuitem; typedef struct _DbusmenuServer DbusmenuServer; @@ -36,17 +37,17 @@ class NativeWindowViews; // from menu models instead, and it is also per-window specific. class GlobalMenuBarX11 { public: - GlobalMenuBarX11(NativeWindowViews* window); + explicit GlobalMenuBarX11(NativeWindowViews* window); virtual ~GlobalMenuBarX11(); // Creates the object path for DbusemenuServer which is attached to |xid|. - static std::string GetPathForWindow(unsigned long xid); + static std::string GetPathForWindow(gfx::AcceleratedWidget xid); void SetMenu(ui::MenuModel* menu_model); private: // Creates a DbusmenuServer. - void InitServer(unsigned long xid); + void InitServer(gfx::AcceleratedWidget xid); // Create a menu from menu model. void BuildMenuFromModel(ui::MenuModel* model, DbusmenuMenuitem* parent); @@ -60,7 +61,7 @@ class GlobalMenuBarX11 { CHROMEG_CALLBACK_0(GlobalMenuBarX11, void, OnSubMenuShow, DbusmenuMenuitem*); NativeWindowViews* window_; - int xid_; + gfx::AcceleratedWidget xid_; DbusmenuServer* server_;