From: Cheng Zhao Date: Fri, 11 Jul 2014 01:18:06 +0000 (+0800) Subject: linux: Avoid using unsigned long directly. X-Git-Tag: v0.14.0~1^2~35 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=497174bbe4eb518629d5b0660f5c5c8e259223e2;p=electron.git linux: Avoid using unsigned long directly. --- diff --git a/atom/browser/ui/views/global_menu_bar_x11.cc b/atom/browser/ui/views/global_menu_bar_x11.cc index 5ebd79bd..eeecb2a1 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 2416e02d..a3ff7cb8 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_;