diff options
Diffstat (limited to 'views/controls/menu')
-rw-r--r-- | views/controls/menu/menu_controller.cc | 6 | ||||
-rw-r--r-- | views/controls/menu/menu_controller.h | 4 | ||||
-rw-r--r-- | views/controls/menu/menu_host_gtk.cc | 8 | ||||
-rw-r--r-- | views/controls/menu/menu_host_gtk.h | 4 | ||||
-rw-r--r-- | views/controls/menu/menu_host_win.h | 2 | ||||
-rw-r--r-- | views/controls/menu/menu_item_view.cc | 4 | ||||
-rw-r--r-- | views/controls/menu/menu_item_view.h | 4 | ||||
-rw-r--r-- | views/controls/menu/submenu_view.cc | 6 | ||||
-rw-r--r-- | views/controls/menu/submenu_view.h | 6 | ||||
-rw-r--r-- | views/controls/menu/view_menu_delegate.h | 4 |
10 files changed, 27 insertions, 21 deletions
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc index 3df3030..6175e62 100644 --- a/views/controls/menu/menu_controller.cc +++ b/views/controls/menu/menu_controller.cc @@ -142,7 +142,7 @@ static int instance_count = 0; static int nested_depth = 0; #endif -MenuItemView* MenuController::Run(gfx::NativeView parent, +MenuItemView* MenuController::Run(gfx::NativeWindow parent, MenuItemView* root, const gfx::Rect& bounds, MenuItemView::AnchorPosition position, @@ -1329,8 +1329,8 @@ void MenuController::RepostEvent(SubmenuView* source, SubmenuView* submenu = state_.item->GetRootMenuItem()->GetSubmenu(); submenu->ReleaseCapture(); - if (submenu->native_view() && submenu->native_view() && - GetWindowThreadProcessId(submenu->native_view(), NULL) != + if (submenu->native_window() && submenu->native_window() && + GetWindowThreadProcessId(submenu->native_window(), NULL) != GetWindowThreadProcessId(window, NULL)) { // Even though we have mouse capture, windows generates a mouse event // if the other window is in a separate thread. Don't generate an event in diff --git a/views/controls/menu/menu_controller.h b/views/controls/menu/menu_controller.h index eb6e87e..bc57036 100644 --- a/views/controls/menu/menu_controller.h +++ b/views/controls/menu/menu_controller.h @@ -43,7 +43,7 @@ class MenuController : public MessageLoopForUI::Dispatcher { // Runs the menu at the specified location. If the menu was configured to // block, the selected item is returned. If the menu does not block this // returns NULL immediately. - MenuItemView* Run(gfx::NativeView parent, + MenuItemView* Run(gfx::NativeWindow parent, MenuItemView* root, const gfx::Rect& bounds, MenuItemView::AnchorPosition position, @@ -353,7 +353,7 @@ class MenuController : public MessageLoopForUI::Dispatcher { MenuDelegate::DropPosition drop_position_; // Owner of child windows. - gfx::NativeView owner_; + gfx::NativeWindow owner_; // Indicates a possible drag operation. bool possible_drag_; diff --git a/views/controls/menu/menu_host_gtk.cc b/views/controls/menu/menu_host_gtk.cc index aee0d17..11033c4 100644 --- a/views/controls/menu/menu_host_gtk.cc +++ b/views/controls/menu/menu_host_gtk.cc @@ -30,11 +30,11 @@ MenuHost::MenuHost(SubmenuView* submenu) } } -void MenuHost::Init(gfx::NativeView parent, +void MenuHost::Init(gfx::NativeWindow parent, const gfx::Rect& bounds, View* contents_view, bool do_capture) { - WidgetGtk::Init(parent, bounds); + WidgetGtk::Init(GTK_WIDGET(parent), bounds); SetContentsView(contents_view); // TODO(sky): see if there is some way to show without changing focus. Show(); @@ -65,6 +65,10 @@ void MenuHost::Init(gfx::NativeView parent, } } +gfx::NativeWindow MenuHost::GetNativeWindow() { + return GTK_WINDOW(GetNativeView()); +} + void MenuHost::Show() { WidgetGtk::Show(); } diff --git a/views/controls/menu/menu_host_gtk.h b/views/controls/menu/menu_host_gtk.h index b3e1f75..8e69ce8 100644 --- a/views/controls/menu/menu_host_gtk.h +++ b/views/controls/menu/menu_host_gtk.h @@ -17,11 +17,13 @@ class MenuHost : public WidgetGtk { public: explicit MenuHost(SubmenuView* submenu); - void Init(gfx::NativeView parent, + void Init(gfx::NativeWindow parent, const gfx::Rect& bounds, View* contents_view, bool do_capture); + gfx::NativeWindow GetNativeWindow(); + void Show(); virtual void Hide(); virtual void HideWindow(); diff --git a/views/controls/menu/menu_host_win.h b/views/controls/menu/menu_host_win.h index 49cc13b..6e645d2 100644 --- a/views/controls/menu/menu_host_win.h +++ b/views/controls/menu/menu_host_win.h @@ -22,6 +22,8 @@ class MenuHost : public WidgetWin { View* contents_view, bool do_capture); + gfx::NativeWindow GetNativeWindow() { return GetNativeView(); } + void Show(); virtual void Hide(); virtual void HideWindow(); diff --git a/views/controls/menu/menu_item_view.cc b/views/controls/menu/menu_item_view.cc index 7a6056f..4d5b3ae 100644 --- a/views/controls/menu/menu_item_view.cc +++ b/views/controls/menu/menu_item_view.cc @@ -82,7 +82,7 @@ MenuItemView::~MenuItemView() { delete submenu_; } -void MenuItemView::RunMenuAt(gfx::NativeView parent, +void MenuItemView::RunMenuAt(gfx::NativeWindow parent, const gfx::Rect& bounds, AnchorPosition anchor, bool has_mnemonics) { @@ -134,7 +134,7 @@ void MenuItemView::RunMenuAt(gfx::NativeView parent, delegate_->ExecuteCommand(result->GetCommand(), mouse_event_flags); } -void MenuItemView::RunMenuForDropAt(gfx::NativeView parent, +void MenuItemView::RunMenuForDropAt(gfx::NativeWindow parent, const gfx::Rect& bounds, AnchorPosition anchor) { PrepareForRun(false); diff --git a/views/controls/menu/menu_item_view.h b/views/controls/menu/menu_item_view.h index 86b1bbf..ecb3b78 100644 --- a/views/controls/menu/menu_item_view.h +++ b/views/controls/menu/menu_item_view.h @@ -81,11 +81,11 @@ class MenuItemView : public View { // a rectangle, which is used to position the menu. |has_mnemonics| indicates // whether the items have mnemonics. Mnemonics are identified by way of the // character following the '&'. - void RunMenuAt(gfx::NativeView parent, + void RunMenuAt(gfx::NativeWindow parent, const gfx::Rect& bounds, AnchorPosition anchor, bool has_mnemonics); - void RunMenuForDropAt(gfx::NativeView parent, + void RunMenuForDropAt(gfx::NativeWindow parent, const gfx::Rect& bounds, AnchorPosition anchor); diff --git a/views/controls/menu/submenu_view.cc b/views/controls/menu/submenu_view.cc index 36495c9..d08de6f 100644 --- a/views/controls/menu/submenu_view.cc +++ b/views/controls/menu/submenu_view.cc @@ -216,7 +216,7 @@ bool SubmenuView::IsShowing() { return host_ && host_->IsVisible(); } -void SubmenuView::ShowAt(gfx::NativeView parent, +void SubmenuView::ShowAt(gfx::NativeWindow parent, const gfx::Rect& bounds, bool do_capture) { if (host_) { @@ -280,8 +280,8 @@ MenuScrollViewContainer* SubmenuView::GetScrollViewContainer() { return scroll_view_container_; } -gfx::NativeView SubmenuView::native_view() const { - return host_ ? host_->GetNativeView() : NULL; +gfx::NativeWindow SubmenuView::native_window() const { + return host_ ? host_->GetNativeWindow() : NULL; } void SubmenuView::PaintDropIndicator(gfx::Canvas* canvas, diff --git a/views/controls/menu/submenu_view.h b/views/controls/menu/submenu_view.h index c8bce96..8cc4461 100644 --- a/views/controls/menu/submenu_view.h +++ b/views/controls/menu/submenu_view.h @@ -74,7 +74,7 @@ class SubmenuView : public View { // Shows the menu at the specified location. Coordinates are in screen // coordinates. max_width gives the max width the view should be. - void ShowAt(gfx::NativeView parent, const gfx::Rect& bounds, bool do_capture); + void ShowAt(gfx::NativeWindow parent, const gfx::Rect& bounds, bool do_capture); // Closes the menu, destroying the host. void Close(); @@ -112,8 +112,8 @@ class SubmenuView : public View { // Returns the container for the SubmenuView. MenuScrollViewContainer* GetScrollViewContainer(); - // Returns the NativeView host of the menu, or NULL if not showing. - gfx::NativeView native_view() const; + // Returns the NativeWindow host of the menu, or NULL if not showing. + gfx::NativeWindow native_window() const; // Padding around the edges of the submenu. static const int kSubmenuBorderSize; diff --git a/views/controls/menu/view_menu_delegate.h b/views/controls/menu/view_menu_delegate.h index c267e9b..9a3a447 100644 --- a/views/controls/menu/view_menu_delegate.h +++ b/views/controls/menu/view_menu_delegate.h @@ -28,9 +28,7 @@ class ViewMenuDelegate { public: // Create and show a menu at the specified position. Source is the view the // ViewMenuDelegate was set on. - virtual void RunMenu(View* source, - const gfx::Point& pt, - gfx::NativeView hwnd) = 0; + virtual void RunMenu(View* source, const gfx::Point& pt) = 0; }; } // namespace views |