summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-12 19:22:26 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-12 19:22:26 +0000
commitd6d6d586d2a91d13d06a8bce53a2d03f2458f9c2 (patch)
treef662039f70110c555ec6fb096b389b73af31af2d
parent7587ee0fa4399ed0485559559b0ee9228daf0337 (diff)
downloadchromium_src-d6d6d586d2a91d13d06a8bce53a2d03f2458f9c2.zip
chromium_src-d6d6d586d2a91d13d06a8bce53a2d03f2458f9c2.tar.gz
chromium_src-d6d6d586d2a91d13d06a8bce53a2d03f2458f9c2.tar.bz2
Converts some uses of native_view to native_window. This is necessitated
by wanting to parent bookmarkeditor to browserwindow, which returns a native_window. BUG=none TEST=none Review URL: http://codereview.chromium.org/270067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28728 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_controller.cc6
-rw-r--r--chrome/browser/bookmarks/bookmark_context_menu_controller.h5
-rw-r--r--chrome/browser/bookmarks/bookmark_editor.h2
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.cc6
-rw-r--r--chrome/browser/bookmarks/bookmark_utils.h4
-rw-r--r--chrome/browser/browser.cc3
-rw-r--r--chrome/browser/chromeos/clock_menu_button.cc3
-rw-r--r--chrome/browser/chromeos/clock_menu_button.h3
-rw-r--r--chrome/browser/chromeos/network_menu_button.cc3
-rw-r--r--chrome/browser/chromeos/network_menu_button.h3
-rw-r--r--chrome/browser/chromeos/power_menu_button.cc3
-rw-r--r--chrome/browser/chromeos/power_menu_button.h3
-rwxr-xr-xchrome/browser/chromeos/status_area_view.cc3
-rwxr-xr-xchrome/browser/chromeos/status_area_view.h3
-rw-r--r--chrome/browser/cocoa/bookmark_editor_controller.mm5
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc6
-rw-r--r--chrome/browser/gtk/bookmark_bubble_gtk.cc2
-rw-r--r--chrome/browser/gtk/bookmark_context_menu_gtk.cc6
-rw-r--r--chrome/browser/gtk/bookmark_context_menu_gtk.h4
-rw-r--r--chrome/browser/gtk/bookmark_editor_gtk.cc6
-rw-r--r--chrome/browser/gtk/bookmark_manager_gtk.cc9
-rw-r--r--chrome/browser/gtk/bookmark_menu_controller_gtk.cc2
-rw-r--r--chrome/browser/input_window_dialog.h6
-rw-r--r--chrome/browser/input_window_dialog_gtk.cc4
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc12
-rw-r--r--chrome/browser/views/bookmark_bar_view.h3
-rw-r--r--chrome/browser/views/bookmark_bubble_view.cc2
-rw-r--r--chrome/browser/views/bookmark_context_menu.cc2
-rw-r--r--chrome/browser/views/bookmark_context_menu.h4
-rw-r--r--chrome/browser/views/bookmark_manager_view.cc20
-rw-r--r--chrome/browser/views/bookmark_manager_view.h8
-rw-r--r--chrome/browser/views/bookmark_menu_button.cc11
-rw-r--r--chrome/browser/views/bookmark_menu_button.h6
-rw-r--r--chrome/browser/views/bookmark_menu_controller_views.cc2
-rw-r--r--chrome/browser/views/bookmark_menu_controller_views.h4
-rw-r--r--chrome/browser/views/toolbar_view.cc11
-rw-r--r--chrome/browser/views/toolbar_view.h7
-rw-r--r--views/controls/button/menu_button.cc27
-rw-r--r--views/controls/menu/menu_controller.cc6
-rw-r--r--views/controls/menu/menu_controller.h4
-rw-r--r--views/controls/menu/menu_host_gtk.cc8
-rw-r--r--views/controls/menu/menu_host_gtk.h4
-rw-r--r--views/controls/menu/menu_host_win.h2
-rw-r--r--views/controls/menu/menu_item_view.cc4
-rw-r--r--views/controls/menu/menu_item_view.h4
-rw-r--r--views/controls/menu/submenu_view.cc6
-rw-r--r--views/controls/menu/submenu_view.h6
-rw-r--r--views/controls/menu/view_menu_delegate.h4
48 files changed, 118 insertions, 149 deletions
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
index 3030e6e..15791a8 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
+++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc
@@ -48,7 +48,7 @@ class EditFolderController : public InputWindowDialog::Delegate,
}
static void Show(Profile* profile,
- gfx::NativeView wnd,
+ gfx::NativeWindow wnd,
const BookmarkNode* node,
bool is_new,
bool show_in_manager) {
@@ -60,7 +60,7 @@ class EditFolderController : public InputWindowDialog::Delegate,
private:
EditFolderController(Profile* profile,
- gfx::NativeView wnd,
+ gfx::NativeWindow wnd,
const BookmarkNode* node,
bool is_new,
bool show_in_manager)
@@ -193,7 +193,7 @@ class SelectOnCreationHandler : public BookmarkEditor::Handler {
} // namespace
BookmarkContextMenuController::BookmarkContextMenuController(
- gfx::NativeView parent_window,
+ gfx::NativeWindow parent_window,
BookmarkContextMenuControllerDelegate* delegate,
Profile* profile,
PageNavigator* navigator,
diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.h b/chrome/browser/bookmarks/bookmark_context_menu_controller.h
index 5c8c20b..66f9f61 100644
--- a/chrome/browser/bookmarks/bookmark_context_menu_controller.h
+++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.h
@@ -56,7 +56,7 @@ class BookmarkContextMenuController : public BookmarkModelObserver {
// |selection| is the nodes the context menu operates on and may be empty.
// |configuration| determines which items to show.
BookmarkContextMenuController(
- gfx::NativeView parent_window,
+ gfx::NativeWindow parent_window,
BookmarkContextMenuControllerDelegate* delegate,
Profile* profile,
PageNavigator* navigator,
@@ -113,8 +113,7 @@ class BookmarkContextMenuController : public BookmarkModelObserver {
// parent_ is returned.
const BookmarkNode* GetParentForNewNodes() const;
- // TODO(beng): change to gfx::NativeWindow
- gfx::NativeView parent_window_;
+ gfx::NativeWindow parent_window_;
BookmarkContextMenuControllerDelegate* delegate_;
Profile* profile_;
PageNavigator* navigator_;
diff --git a/chrome/browser/bookmarks/bookmark_editor.h b/chrome/browser/bookmarks/bookmark_editor.h
index 6c82cbd..0b98406 100644
--- a/chrome/browser/bookmarks/bookmark_editor.h
+++ b/chrome/browser/bookmarks/bookmark_editor.h
@@ -38,7 +38,7 @@ class BookmarkEditor {
// If |show_tree| is false the tree is not shown. BookmarkEditor takes
// ownership of |handler| and deletes it when done. |handler| may be
// null. See description of Handler for details.
- static void Show(gfx::NativeView parent_window,
+ static void Show(gfx::NativeWindow parent_window,
Profile* profile,
const BookmarkNode* parent,
const BookmarkNode* node,
diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc
index e64c42d..a8f5860 100644
--- a/chrome/browser/bookmarks/bookmark_utils.cc
+++ b/chrome/browser/bookmarks/bookmark_utils.cc
@@ -138,7 +138,7 @@ void OpenAllImpl(const BookmarkNode* node,
}
}
-bool ShouldOpenAll(gfx::NativeView parent,
+bool ShouldOpenAll(gfx::NativeWindow parent,
const std::vector<const BookmarkNode*>& nodes) {
int descendant_count = 0;
for (size_t i = 0; i < nodes.size(); ++i)
@@ -310,7 +310,7 @@ void CloneDragData(BookmarkModel* model,
CloneDragDataImpl(model, elements[i], parent, index_to_add_at + i);
}
-void OpenAll(gfx::NativeView parent,
+void OpenAll(gfx::NativeWindow parent,
Profile* profile,
PageNavigator* navigator,
const std::vector<const BookmarkNode*>& nodes,
@@ -338,7 +338,7 @@ void OpenAll(gfx::NativeView parent,
OpenAllImpl(nodes[i], initial_disposition, &navigator, &opened_url);
}
-void OpenAll(gfx::NativeView parent,
+void OpenAll(gfx::NativeWindow parent,
Profile* profile,
PageNavigator* navigator,
const BookmarkNode* node,
diff --git a/chrome/browser/bookmarks/bookmark_utils.h b/chrome/browser/bookmarks/bookmark_utils.h
index 513f479..0c5d53d 100644
--- a/chrome/browser/bookmarks/bookmark_utils.h
+++ b/chrome/browser/bookmarks/bookmark_utils.h
@@ -76,14 +76,14 @@ void CloneDragData(BookmarkModel* model,
// |navigator| is used to open the URLs. If |navigator| is NULL the last
// tabbed browser with the profile |profile| is used. If there is no browser
// with the specified profile a new one is created.
-void OpenAll(gfx::NativeView parent,
+void OpenAll(gfx::NativeWindow parent,
Profile* profile,
PageNavigator* navigator,
const std::vector<const BookmarkNode*>& nodes,
WindowOpenDisposition initial_disposition);
// Convenience for opening a single BookmarkNode.
-void OpenAll(gfx::NativeView parent,
+void OpenAll(gfx::NativeWindow parent,
Profile* profile,
PageNavigator* navigator,
const BookmarkNode* node,
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 78191f7..f1ece51 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1688,12 +1688,9 @@ void Browser::BookmarkAllTabs() {
if (!node)
return;
- // TODO(sky): BookmarkEditor::Show should take a NativeWindow, not view.
-#if defined(OS_WIN)
BookmarkEditor::Show(window()->GetNativeHandle(), profile_,
node->GetParent(), node, BookmarkEditor::SHOW_TREE,
NULL);
-#endif
}
///////////////////////////////////////////////////////////////////////////////
diff --git a/chrome/browser/chromeos/clock_menu_button.cc b/chrome/browser/chromeos/clock_menu_button.cc
index e1d4a85..a628cc8 100644
--- a/chrome/browser/chromeos/clock_menu_button.cc
+++ b/chrome/browser/chromeos/clock_menu_button.cc
@@ -89,8 +89,7 @@ string16 ClockMenuButton::GetLabelAt(int index) const {
////////////////////////////////////////////////////////////////////////////////
// ClockMenuButton, views::ViewMenuDelegate implementation:
-void ClockMenuButton::RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView hwnd) {
+void ClockMenuButton::RunMenu(views::View* source, const gfx::Point& pt) {
clock_menu_.Rebuild();
clock_menu_.UpdateStates();
clock_menu_.RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
diff --git a/chrome/browser/chromeos/clock_menu_button.h b/chrome/browser/chromeos/clock_menu_button.h
index 8fca16e..54d0389 100644
--- a/chrome/browser/chromeos/clock_menu_button.h
+++ b/chrome/browser/chromeos/clock_menu_button.h
@@ -39,8 +39,7 @@ class ClockMenuButton : public views::MenuButton,
private:
// views::ViewMenuDelegate implementation.
- virtual void RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView hwnd);
+ virtual void RunMenu(views::View* source, const gfx::Point& pt);
// Schedules the timer to fire at the next minute interval.
void SetNextTimer();
diff --git a/chrome/browser/chromeos/network_menu_button.cc b/chrome/browser/chromeos/network_menu_button.cc
index 46853ba..9ee7de9 100644
--- a/chrome/browser/chromeos/network_menu_button.cc
+++ b/chrome/browser/chromeos/network_menu_button.cc
@@ -127,8 +127,7 @@ void NetworkMenuButton::AnimationProgressed(const Animation* animation) {
////////////////////////////////////////////////////////////////////////////////
// NetworkMenuButton, views::ViewMenuDelegate implementation:
-void NetworkMenuButton::RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView hwnd) {
+void NetworkMenuButton::RunMenu(views::View* source, const gfx::Point& pt) {
wifi_networks_ = CrosNetworkLibrary::Get()->GetWifiNetworks();
refreshing_menu_ = true;
network_menu_.Rebuild();
diff --git a/chrome/browser/chromeos/network_menu_button.h b/chrome/browser/chromeos/network_menu_button.h
index 7247325..d0925a25 100644
--- a/chrome/browser/chromeos/network_menu_button.h
+++ b/chrome/browser/chromeos/network_menu_button.h
@@ -62,8 +62,7 @@ class NetworkMenuButton : public views::MenuButton,
private:
// views::ViewMenuDelegate implementation.
- virtual void RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView hwnd);
+ virtual void RunMenu(views::View* source, const gfx::Point& pt);
// Update the icon to either the connecting, connected, or disconnected icon.
void UpdateIcon();
diff --git a/chrome/browser/chromeos/power_menu_button.cc b/chrome/browser/chromeos/power_menu_button.cc
index e2dd205..b15c559 100644
--- a/chrome/browser/chromeos/power_menu_button.cc
+++ b/chrome/browser/chromeos/power_menu_button.cc
@@ -85,8 +85,7 @@ string16 PowerMenuButton::GetLabelAt(int index) const {
////////////////////////////////////////////////////////////////////////////////
// PowerMenuButton, views::ViewMenuDelegate implementation:
-void PowerMenuButton::RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView hwnd) {
+void PowerMenuButton::RunMenu(views::View* source, const gfx::Point& pt) {
power_menu_.Rebuild();
power_menu_.UpdateStates();
power_menu_.RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
diff --git a/chrome/browser/chromeos/power_menu_button.h b/chrome/browser/chromeos/power_menu_button.h
index 4c3252a..7abe100 100644
--- a/chrome/browser/chromeos/power_menu_button.h
+++ b/chrome/browser/chromeos/power_menu_button.h
@@ -47,8 +47,7 @@ class PowerMenuButton : public views::MenuButton,
private:
// views::ViewMenuDelegate implementation.
- virtual void RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView hwnd);
+ virtual void RunMenu(views::View* source, const gfx::Point& pt);
// Update the power icon depending on the power status.
void UpdateIcon();
diff --git a/chrome/browser/chromeos/status_area_view.cc b/chrome/browser/chromeos/status_area_view.cc
index ed17b6d..2d25d62 100755
--- a/chrome/browser/chromeos/status_area_view.cc
+++ b/chrome/browser/chromeos/status_area_view.cc
@@ -259,8 +259,7 @@ void StatusAreaView::ExecuteCommand(int command_id) {
browser_->ExecuteCommand(command_id);
}
-void StatusAreaView::RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView hwnd) {
+void StatusAreaView::RunMenu(views::View* source, const gfx::Point& pt) {
CreateAppMenu();
app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
}
diff --git a/chrome/browser/chromeos/status_area_view.h b/chrome/browser/chromeos/status_area_view.h
index 76f7873..8fbd5f5 100755
--- a/chrome/browser/chromeos/status_area_view.h
+++ b/chrome/browser/chromeos/status_area_view.h
@@ -55,8 +55,7 @@ class StatusAreaView : public views::View,
virtual void ExecuteCommand(int command_id);
// views::ViewMenuDelegate implementation.
- virtual void RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView hwnd);
+ virtual void RunMenu(views::View* source, const gfx::Point& pt);
// The browser window that owns us.
Browser* browser_;
diff --git a/chrome/browser/cocoa/bookmark_editor_controller.mm b/chrome/browser/cocoa/bookmark_editor_controller.mm
index bfa8156..dc65dfa 100644
--- a/chrome/browser/cocoa/bookmark_editor_controller.mm
+++ b/chrome/browser/cocoa/bookmark_editor_controller.mm
@@ -11,15 +11,14 @@
#import "chrome/browser/cocoa/bookmark_editor_controller.h"
// static; implemented for each platform.
-void BookmarkEditor::Show(gfx::NativeView parent_hwnd,
+void BookmarkEditor::Show(gfx::NativeWindow parent_hwnd,
Profile* profile,
const BookmarkNode* parent,
const BookmarkNode* node,
Configuration configuration,
Handler* handler) {
- NSWindow* window = [parent_hwnd window];
BookmarkEditorController* controller = [[BookmarkEditorController alloc]
- initWithParentWindow:window
+ initWithParentWindow:parent_hwnd
profile:profile
parent:parent
node:node
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index 17f7383..9bcbb80 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -754,8 +754,9 @@ void BookmarkBarGtk::PopupMenuForNode(GtkWidget* sender,
nodes.push_back(parent);
}
+ GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(sender));
current_context_menu_.reset(new BookmarkContextMenuGtk(
- sender, profile_, browser_, page_navigator_,
+ window, profile_, browser_, page_navigator_,
parent, nodes,
BookmarkContextMenuGtk::BOOKMARK_BAR, NULL));
current_context_menu_->PopupAsContext(event->time);
@@ -791,8 +792,9 @@ void BookmarkBarGtk::OnClicked(GtkWidget* sender,
event_utils::DispositionFromEventFlags(event->state),
PageTransition::AUTO_BOOKMARK);
} else {
+ GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(sender));
bookmark_utils::OpenAll(
- sender, bar->profile_, bar->page_navigator_, node,
+ window, bar->profile_, bar->page_navigator_, node,
event_utils::DispositionFromEventFlags(event->state));
}
diff --git a/chrome/browser/gtk/bookmark_bubble_gtk.cc b/chrome/browser/gtk/bookmark_bubble_gtk.cc
index 3c71a9c..c43a7a0 100644
--- a/chrome/browser/gtk/bookmark_bubble_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bubble_gtk.cc
@@ -363,7 +363,7 @@ void BookmarkBubbleGtk::ShowEditor() {
// Closing might delete us, so we'll cache what we want we need on the stack.
Profile* profile = profile_;
- GtkWidget* toplevel = GTK_WIDGET(toplevel_window_);
+ GtkWindow* toplevel = toplevel_window_;
// Close the bubble, deleting the C++ objects, etc.
bubble_->Close();
diff --git a/chrome/browser/gtk/bookmark_context_menu_gtk.cc b/chrome/browser/gtk/bookmark_context_menu_gtk.cc
index 8eb032d..9c3f03c 100644
--- a/chrome/browser/gtk/bookmark_context_menu_gtk.cc
+++ b/chrome/browser/gtk/bookmark_context_menu_gtk.cc
@@ -51,7 +51,7 @@ class EditFolderController : public InputWindowDialog::Delegate,
}
static void Show(Profile* profile,
- gfx::NativeView wnd,
+ gfx::NativeWindow wnd,
const BookmarkNode* node,
bool is_new,
bool show_in_manager) {
@@ -63,7 +63,7 @@ class EditFolderController : public InputWindowDialog::Delegate,
private:
EditFolderController(Profile* profile,
- gfx::NativeView wnd,
+ gfx::NativeWindow wnd,
const BookmarkNode* node,
bool is_new,
bool show_in_manager)
@@ -198,7 +198,7 @@ class SelectOnCreationHandler : public BookmarkEditor::Handler {
// BookmarkContextMenuGtk -------------------------------------------
BookmarkContextMenuGtk::BookmarkContextMenuGtk(
- gfx::NativeView wnd,
+ gfx::NativeWindow wnd,
Profile* profile,
Browser* browser,
PageNavigator* navigator,
diff --git a/chrome/browser/gtk/bookmark_context_menu_gtk.h b/chrome/browser/gtk/bookmark_context_menu_gtk.h
index efe684d..3680c65 100644
--- a/chrome/browser/gtk/bookmark_context_menu_gtk.h
+++ b/chrome/browser/gtk/bookmark_context_menu_gtk.h
@@ -50,7 +50,7 @@ class BookmarkContextMenuGtk : public BookmarkModelObserver,
// |parent| is the parent for newly created nodes if |selection| is empty.
// |selection| is the nodes the context menu operates on and may be empty.
// |configuration| determines which items to show.
- BookmarkContextMenuGtk(gfx::NativeView hwnd,
+ BookmarkContextMenuGtk(gfx::NativeWindow hwnd,
Profile* profile,
Browser* browser,
PageNavigator* navigator,
@@ -124,7 +124,7 @@ class BookmarkContextMenuGtk : public BookmarkModelObserver,
// parent_ is returned.
const BookmarkNode* GetParentForNewNodes() const;
- gfx::NativeView wnd_;
+ gfx::NativeWindow wnd_;
Profile* profile_;
Browser* browser_;
PageNavigator* navigator_;
diff --git a/chrome/browser/gtk/bookmark_editor_gtk.cc b/chrome/browser/gtk/bookmark_editor_gtk.cc
index 17bd8d1..7b08648 100644
--- a/chrome/browser/gtk/bookmark_editor_gtk.cc
+++ b/chrome/browser/gtk/bookmark_editor_gtk.cc
@@ -37,7 +37,7 @@ static const int kTreeHeight = 150;
} // namespace
// static
-void BookmarkEditor::Show(gfx::NativeView parent_hwnd,
+void BookmarkEditor::Show(gfx::NativeWindow parent_hwnd,
Profile* profile,
const BookmarkNode* parent,
const BookmarkNode* node,
@@ -45,8 +45,8 @@ void BookmarkEditor::Show(gfx::NativeView parent_hwnd,
Handler* handler) {
DCHECK(profile);
BookmarkEditorGtk* editor =
- new BookmarkEditorGtk(GTK_WINDOW(gtk_widget_get_toplevel(parent_hwnd)),
- profile, parent, node, configuration, handler);
+ new BookmarkEditorGtk(parent_hwnd, profile, parent, node, configuration,
+ handler);
editor->Show();
}
diff --git a/chrome/browser/gtk/bookmark_manager_gtk.cc b/chrome/browser/gtk/bookmark_manager_gtk.cc
index 6277690..0ffb725 100644
--- a/chrome/browser/gtk/bookmark_manager_gtk.cc
+++ b/chrome/browser/gtk/bookmark_manager_gtk.cc
@@ -606,9 +606,9 @@ void BookmarkManagerGtk::ResetOrganizeMenu(bool left) {
if (old_menu)
MessageLoop::current()->DeleteSoon(FROM_HERE, old_menu);
- organize_menu_.reset(new BookmarkContextMenuGtk(window_, profile_, NULL, NULL,
- parent, nodes, BookmarkContextMenuGtk::BOOKMARK_MANAGER_ORGANIZE_MENU,
- NULL));
+ organize_menu_.reset(new BookmarkContextMenuGtk(GTK_WINDOW(window_), profile_,
+ NULL, NULL, parent, nodes,
+ BookmarkContextMenuGtk::BOOKMARK_MANAGER_ORGANIZE_MENU, NULL));
gtk_menu_item_set_submenu(GTK_MENU_ITEM(organize_), organize_menu_->menu());
}
@@ -1130,7 +1130,8 @@ void BookmarkManagerGtk::OnRightTreeViewRowActivated(
bm->SelectInTree(nodes[0], false);
return;
}
- bookmark_utils::OpenAll(bm->window_, bm->profile_, NULL, nodes, CURRENT_TAB);
+ bookmark_utils::OpenAll(GTK_WINDOW(bm->window_), bm->profile_, NULL, nodes,
+ CURRENT_TAB);
}
// static
diff --git a/chrome/browser/gtk/bookmark_menu_controller_gtk.cc b/chrome/browser/gtk/bookmark_menu_controller_gtk.cc
index ed436a7..b835dcc 100644
--- a/chrome/browser/gtk/bookmark_menu_controller_gtk.cc
+++ b/chrome/browser/gtk/bookmark_menu_controller_gtk.cc
@@ -251,7 +251,7 @@ gboolean BookmarkMenuController::OnButtonPressed(
nodes.push_back(node);
controller->context_menu_.reset(
new BookmarkContextMenuGtk(
- GTK_WIDGET(controller->parent_window_), controller->profile_,
+ controller->parent_window_, controller->profile_,
controller->browser_, controller->page_navigator_, parent, nodes,
BookmarkContextMenuGtk::BOOKMARK_BAR, controller));
diff --git a/chrome/browser/input_window_dialog.h b/chrome/browser/input_window_dialog.h
index e60e3f6..707c108 100644
--- a/chrome/browser/input_window_dialog.h
+++ b/chrome/browser/input_window_dialog.h
@@ -15,7 +15,7 @@ class InputWindowDialog {
public:
class Delegate {
public:
- virtual ~Delegate() { }
+ virtual ~Delegate() {}
// Checks whether |text| is a valid input string.
virtual bool IsValid(const std::wstring& text) = 0;
@@ -29,7 +29,7 @@ class InputWindowDialog {
// Creates a new input window dialog parented to |parent|. Ownership of
// |delegate| is taken by InputWindowDialog or InputWindowDialog's owner.
- static InputWindowDialog* Create(gfx::NativeView parent,
+ static InputWindowDialog* Create(gfx::NativeWindow parent,
const std::wstring& window_title,
const std::wstring& label,
const std::wstring& contents,
@@ -42,7 +42,7 @@ class InputWindowDialog {
virtual void Close() = 0;
protected:
- InputWindowDialog() { }
+ InputWindowDialog() {}
private:
DISALLOW_COPY_AND_ASSIGN(InputWindowDialog);
diff --git a/chrome/browser/input_window_dialog_gtk.cc b/chrome/browser/input_window_dialog_gtk.cc
index 353cb39..b6bf5dc 100644
--- a/chrome/browser/input_window_dialog_gtk.cc
+++ b/chrome/browser/input_window_dialog_gtk.cc
@@ -148,12 +148,12 @@ void GtkInputWindowDialog::OnWindowDestroy(GtkWidget* widget,
}
// static
-InputWindowDialog* InputWindowDialog::Create(gfx::NativeView parent,
+InputWindowDialog* InputWindowDialog::Create(gfx::NativeWindow parent,
const std::wstring& window_title,
const std::wstring& label,
const std::wstring& contents,
Delegate* delegate) {
- return new GtkInputWindowDialog(GTK_WINDOW(gtk_widget_get_toplevel(parent)),
+ return new GtkInputWindowDialog(parent,
WideToUTF8(window_title),
WideToUTF8(label),
WideToUTF8(contents),
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index fd9282a..8a485d6 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -1070,9 +1070,7 @@ int BookmarkBarView::GetDragOperations(View* sender, int x, int y) {
return DragDropTypes::DRAG_NONE;
}
-void BookmarkBarView::RunMenu(views::View* view,
- const gfx::Point& pt,
- gfx::NativeView hwnd) {
+void BookmarkBarView::RunMenu(views::View* view, const gfx::Point& pt) {
const BookmarkNode* node;
MenuItemView::AnchorPosition anchor_point = MenuItemView::TOPLEFT;
@@ -1117,7 +1115,7 @@ void BookmarkBarView::RunMenu(views::View* view,
gfx::Point screen_loc(x, 0);
View::ConvertPointToScreen(this, &screen_loc);
bookmark_menu_ = new BookmarkMenuController(
- browser_, profile_, page_navigator_, GetWidget()->GetNativeView(),
+ browser_, profile_, page_navigator_, GetWindow()->GetNativeWindow(),
node, start_index, false);
bookmark_menu_->set_observer(this);
bookmark_menu_->RunMenuAt(gfx::Rect(screen_loc.x(), screen_loc.y(),
@@ -1160,7 +1158,7 @@ void BookmarkBarView::ButtonPressed(views::Button* sender,
page_navigator_->OpenURL(node->GetURL(), GURL(),
disposition_from_event_flags, PageTransition::AUTO_BOOKMARK);
} else {
- bookmark_utils::OpenAll(GetWidget()->GetNativeView(), profile_,
+ bookmark_utils::OpenAll(GetWindow()->GetNativeWindow(), profile_,
GetPageNavigator(), node, disposition_from_event_flags);
}
UserMetrics::RecordAction(L"ClickedBookmarkBarURLButton", profile_);
@@ -1196,7 +1194,7 @@ void BookmarkBarView::ShowContextMenu(View* source,
parent = model_->GetBookmarkBarNode();
nodes.push_back(parent);
}
- BookmarkContextMenu controller(GetWidget()->GetNativeView(), GetProfile(),
+ BookmarkContextMenu controller(GetWindow()->GetNativeWindow(), GetProfile(),
browser()->GetSelectedTabContents(),
parent, nodes,
BookmarkContextMenuController::BOOKMARK_BAR);
@@ -1338,7 +1336,7 @@ void BookmarkBarView::ShowDropFolderForNode(const BookmarkNode* node) {
drop_info_->is_menu_showing = true;
bookmark_drop_menu_ = new BookmarkMenuController(
- browser_, profile_, page_navigator_, GetWidget()->GetNativeView(),
+ browser_, profile_, page_navigator_, GetWindow()->GetNativeWindow(),
node, start_index, false);
bookmark_drop_menu_->set_observer(this);
gfx::Point screen_loc;
diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h
index 20fcc07..f331620 100644
--- a/chrome/browser/views/bookmark_bar_view.h
+++ b/chrome/browser/views/bookmark_bar_view.h
@@ -323,8 +323,7 @@ class BookmarkBarView : public DetachableToolbarView,
// . menu for star groups.
// The latter two are handled by a MenuRunner, which builds the appropriate
// menu.
- virtual void RunMenu(views::View* view, const gfx::Point& pt,
- gfx::NativeView parent);
+ virtual void RunMenu(views::View* view, const gfx::Point& pt);
// Invoked when a star entry corresponding to a URL on the bookmark bar is
// pressed. Forwards to the PageNavigator to open the URL.
diff --git a/chrome/browser/views/bookmark_bubble_view.cc b/chrome/browser/views/bookmark_bubble_view.cc
index f0acd1f..183498f 100644
--- a/chrome/browser/views/bookmark_bubble_view.cc
+++ b/chrome/browser/views/bookmark_bubble_view.cc
@@ -411,7 +411,7 @@ void BookmarkBubbleView::ShowEditor() {
// restored to the browser.
ShowWindow(GetWidget()->GetNativeView(), SW_HIDE);
#else
- gfx::NativeView parent = GTK_WIDGET(
+ gfx::NativeWindow parent = GTK_WINDOW(
static_cast<views::WidgetGtk*>(GetWidget())->GetTransientParent());
#endif
diff --git a/chrome/browser/views/bookmark_context_menu.cc b/chrome/browser/views/bookmark_context_menu.cc
index 9e5a769..f1881c5 100644
--- a/chrome/browser/views/bookmark_context_menu.cc
+++ b/chrome/browser/views/bookmark_context_menu.cc
@@ -13,7 +13,7 @@
// BookmarkContextMenu, public:
BookmarkContextMenu::BookmarkContextMenu(
- gfx::NativeView parent_window,
+ gfx::NativeWindow parent_window,
Profile* profile,
PageNavigator* page_navigator,
const BookmarkNode* parent,
diff --git a/chrome/browser/views/bookmark_context_menu.h b/chrome/browser/views/bookmark_context_menu.h
index d541bdb..3771104 100644
--- a/chrome/browser/views/bookmark_context_menu.h
+++ b/chrome/browser/views/bookmark_context_menu.h
@@ -12,7 +12,7 @@ class BookmarkContextMenu : public BookmarkContextMenuControllerDelegate,
public views::MenuDelegate {
public:
BookmarkContextMenu(
- gfx::NativeView parent_window,
+ gfx::NativeWindow parent_window,
Profile* profile,
PageNavigator* page_navigator,
const BookmarkNode* parent,
@@ -41,7 +41,7 @@ class BookmarkContextMenu : public BookmarkContextMenuControllerDelegate,
scoped_ptr<BookmarkContextMenuController> controller_;
// The parent of dialog boxes opened from the context menu.
- gfx::NativeView parent_window_;
+ gfx::NativeWindow parent_window_;
// The menu itself.
scoped_ptr<views::MenuItemView> menu_;
diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc
index 96345ff..1cad2735 100644
--- a/chrome/browser/views/bookmark_manager_view.cc
+++ b/chrome/browser/views/bookmark_manager_view.cc
@@ -564,14 +564,12 @@ void BookmarkManagerView::ShowContextMenu(views::View* source,
bool is_mouse_gesture) {
DCHECK(source == table_view_ || source == tree_view_);
bool is_table = (source == table_view_);
- ShowMenu(GetWidget()->GetNativeView(), x, y,
+ ShowMenu(x, y,
is_table ? BookmarkContextMenuController::BOOKMARK_MANAGER_TABLE :
BookmarkContextMenuController::BOOKMARK_MANAGER_TREE);
}
-void BookmarkManagerView::RunMenu(views::View* source,
- const gfx::Point& pt,
- HWND hwnd) {
+void BookmarkManagerView::RunMenu(views::View* source, const gfx::Point& pt) {
// TODO(glen): when you change the buttons around and what not, futz with
// this to make it look good. If you end up keeping padding numbers make them
// constants.
@@ -582,10 +580,10 @@ void BookmarkManagerView::RunMenu(views::View* source,
menu_x += UILayoutIsRightToLeft() ? (source->width() - 5) :
(-source->width() + 5);
if (source->GetID() == kOrganizeMenuButtonID) {
- ShowMenu(hwnd, menu_x, pt.y() + 2,
+ ShowMenu(menu_x, pt.y() + 2,
BookmarkContextMenuController::BOOKMARK_MANAGER_ORGANIZE_MENU);
} else if (source->GetID() == kToolsMenuButtonID) {
- ShowToolsMenu(hwnd, menu_x, pt.y() + 2);
+ ShowToolsMenu(menu_x, pt.y() + 2);
} else {
NOTREACHED();
}
@@ -732,10 +730,7 @@ BookmarkModel* BookmarkManagerView::GetBookmarkModel() const {
}
void BookmarkManagerView::ShowMenu(
- HWND host,
- int x,
- int y,
- BookmarkContextMenuController::ConfigurationType config) {
+ int x, int y, BookmarkContextMenuController::ConfigurationType config) {
if (!GetBookmarkModel()->IsLoaded())
return;
@@ -753,7 +748,8 @@ void BookmarkManagerView::ShowMenu(
BookmarkContextMenuController::BOOKMARK_MANAGER_ORGANIZE_MENU_OTHER;
}
}
- BookmarkContextMenu menu(host, profile_, NULL, parent, nodes, config);
+ BookmarkContextMenu menu(GetWindow()->GetNativeWindow(), profile_, NULL,
+ parent, nodes, config);
menu.RunMenuAt(gfx::Point(x, y));
} else {
const BookmarkNode* node = GetSelectedFolder();
@@ -791,7 +787,7 @@ void BookmarkManagerView::OnCutCopyPaste(CutCopyPasteType type,
}
}
-void BookmarkManagerView::ShowToolsMenu(HWND host, int x, int y) {
+void BookmarkManagerView::ShowToolsMenu(int x, int y) {
views::MenuItemView menu(this);
menu.AppendMenuItemWithLabel(
IDS_BOOKMARK_MANAGER_IMPORT_MENU,
diff --git a/chrome/browser/views/bookmark_manager_view.h b/chrome/browser/views/bookmark_manager_view.h
index af3839c..cfbc33a 100644
--- a/chrome/browser/views/bookmark_manager_view.h
+++ b/chrome/browser/views/bookmark_manager_view.h
@@ -161,7 +161,7 @@ class BookmarkManagerView : public views::View,
bool is_mouse_gesture);
// ViewMenuDelegate.
- virtual void RunMenu(views::View* source, const gfx::Point& pt, HWND hwnd);
+ virtual void RunMenu(views::View* source, const gfx::Point& pt);
// MenuDelegate.
virtual void ExecuteCommand(int id);
@@ -198,9 +198,7 @@ class BookmarkManagerView : public views::View,
// Shows the menu. This is invoked to show the context menu for table/tree
// as well as to show the menu from the organize button.
- void ShowMenu(HWND host,
- int x,
- int y,
+ void ShowMenu(int x, int y,
BookmarkContextMenuController::ConfigurationType config);
// Invoked to handle cut/copy/paste from the table or tree. If |from_table|
@@ -208,7 +206,7 @@ class BookmarkManagerView : public views::View,
void OnCutCopyPaste(CutCopyPasteType type, bool from_table);
// Shows the tools menu.
- void ShowToolsMenu(HWND host, int x, int y);
+ void ShowToolsMenu(int x, int y);
// Shows the import/export file chooser. These invoke
// FileSelected/FileSelectionCanceled when done.
diff --git a/chrome/browser/views/bookmark_menu_button.cc b/chrome/browser/views/bookmark_menu_button.cc
index e3475aa..4255ffd 100644
--- a/chrome/browser/views/bookmark_menu_button.cc
+++ b/chrome/browser/views/bookmark_menu_button.cc
@@ -20,7 +20,7 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/view_ids.h"
#include "grit/theme_resources.h"
-#include "views/widget/widget.h"
+#include "views/window/window.h"
BookmarkMenuButton::BookmarkMenuButton(Browser* browser)
: views::MenuButton(NULL, std::wstring(), NULL, false),
@@ -117,14 +117,13 @@ void BookmarkMenuButton::BookmarkMenuDeleted(
}
void BookmarkMenuButton::RunMenu(views::View* source,
- const gfx::Point& pt,
- gfx::NativeView hwnd) {
- RunMenu(source, pt, hwnd, false);
+ const gfx::Point& pt) {
+ RunMenu(source, pt, GetWindow()->GetNativeWindow(), false);
}
void BookmarkMenuButton::RunMenu(views::View* source,
const gfx::Point& pt,
- gfx::NativeView hwnd,
+ gfx::NativeWindow hwnd,
bool for_drop) {
Profile* profile = browser_->profile();
BookmarkMenuController* menu = new BookmarkMenuController(
@@ -169,5 +168,5 @@ void BookmarkMenuButton::StopShowFolderDropMenuTimer() {
}
void BookmarkMenuButton::ShowDropMenu() {
- RunMenu(NULL, gfx::Point(), GetWidget()->GetNativeView(), true);
+ RunMenu(NULL, gfx::Point(), GetWindow()->GetNativeWindow(), true);
}
diff --git a/chrome/browser/views/bookmark_menu_button.h b/chrome/browser/views/bookmark_menu_button.h
index 7a7fd7e..2ac1fbd 100644
--- a/chrome/browser/views/bookmark_menu_button.h
+++ b/chrome/browser/views/bookmark_menu_button.h
@@ -39,15 +39,13 @@ class BookmarkMenuButton : public views::MenuButton,
virtual void BookmarkMenuDeleted(BookmarkMenuController* controller);
// ViewMenuDelegate.
- virtual void RunMenu(views::View* source,
- const gfx::Point& pt,
- gfx::NativeView hwnd);
+ virtual void RunMenu(views::View* source, const gfx::Point& pt);
private:
// Shows the menu.
void RunMenu(views::View* source,
const gfx::Point& pt,
- gfx::NativeView hwnd,
+ gfx::NativeWindow hwnd,
bool for_drop);
// Returns the bookmark model.
diff --git a/chrome/browser/views/bookmark_menu_controller_views.cc b/chrome/browser/views/bookmark_menu_controller_views.cc
index 4dabc1d..58ff604 100644
--- a/chrome/browser/views/bookmark_menu_controller_views.cc
+++ b/chrome/browser/views/bookmark_menu_controller_views.cc
@@ -21,7 +21,7 @@
BookmarkMenuController::BookmarkMenuController(Browser* browser,
Profile* profile,
PageNavigator* navigator,
- gfx::NativeView parent,
+ gfx::NativeWindow parent,
const BookmarkNode* node,
int start_child_index,
bool show_other_folder)
diff --git a/chrome/browser/views/bookmark_menu_controller_views.h b/chrome/browser/views/bookmark_menu_controller_views.h
index 0fb720a..fa6462f 100644
--- a/chrome/browser/views/bookmark_menu_controller_views.h
+++ b/chrome/browser/views/bookmark_menu_controller_views.h
@@ -43,7 +43,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver,
BookmarkMenuController(Browser* browser,
Profile* profile,
PageNavigator* page_navigator,
- gfx::NativeView parent,
+ gfx::NativeWindow parent,
const BookmarkNode* node,
int start_child_index,
bool show_other_folder);
@@ -120,7 +120,7 @@ class BookmarkMenuController : public BaseBookmarkModelObserver,
PageNavigator* page_navigator_;
// Parent of menus.
- gfx::NativeView parent_;
+ gfx::NativeWindow parent_;
// The node we're showing the contents of.
const BookmarkNode* node_;
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc
index d21db27..8021553 100644
--- a/chrome/browser/views/toolbar_view.cc
+++ b/chrome/browser/views/toolbar_view.cc
@@ -252,14 +252,13 @@ bool ToolbarView::GetAcceleratorInfo(int id, views::Accelerator* accel) {
////////////////////////////////////////////////////////////////////////////////
// ToolbarView, views::MenuDelegate implementation:
-void ToolbarView::RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView parent) {
+void ToolbarView::RunMenu(views::View* source, const gfx::Point& pt) {
switch (source->GetID()) {
case VIEW_ID_PAGE_MENU:
- RunPageMenu(pt, parent);
+ RunPageMenu(pt);
break;
case VIEW_ID_APP_MENU:
- RunAppMenu(pt, parent);
+ RunAppMenu(pt);
break;
default:
NOTREACHED() << "Invalid source menu.";
@@ -997,12 +996,12 @@ void ToolbarView::LoadRightSideControlsImages() {
bookmark_menu_->SetIcon(*tp->GetBitmapNamed(IDR_MENU_BOOKMARK));
}
-void ToolbarView::RunPageMenu(const gfx::Point& pt, gfx::NativeView parent) {
+void ToolbarView::RunPageMenu(const gfx::Point& pt) {
CreatePageMenu();
page_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
}
-void ToolbarView::RunAppMenu(const gfx::Point& pt, gfx::NativeView parent) {
+void ToolbarView::RunAppMenu(const gfx::Point& pt) {
CreateAppMenu();
app_menu_menu_->RunMenuAt(pt, views::Menu2::ALIGN_TOPRIGHT);
}
diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h
index c7080b8..f1ac12d 100644
--- a/chrome/browser/views/toolbar_view.h
+++ b/chrome/browser/views/toolbar_view.h
@@ -114,8 +114,7 @@ class ToolbarView : public views::View,
virtual bool GetAcceleratorInfo(int id, views::Accelerator* accel);
// Overridden from views::MenuDelegate:
- virtual void RunMenu(views::View* source, const gfx::Point& pt,
- gfx::NativeView hwnd);
+ virtual void RunMenu(views::View* source, const gfx::Point& pt);
// Overridden from GetProfilesHelper::Delegate:
virtual void OnGetProfilesDone(const std::vector<std::wstring>& profiles);
@@ -180,8 +179,8 @@ class ToolbarView : public views::View,
void LoadRightSideControlsImages();
// Runs various menus.
- void RunPageMenu(const gfx::Point& pt, gfx::NativeView hwnd);
- void RunAppMenu(const gfx::Point& pt, gfx::NativeView hwnd);
+ void RunPageMenu(const gfx::Point& pt);
+ void RunAppMenu(const gfx::Point& pt);
void CreatePageMenu();
void CreateZoomMenuContents();
diff --git a/views/controls/button/menu_button.cc b/views/controls/button/menu_button.cc
index 5b353f3..7f1daf7 100644
--- a/views/controls/button/menu_button.cc
+++ b/views/controls/button/menu_button.cc
@@ -13,12 +13,10 @@
#include "views/controls/button/button.h"
#include "views/controls/menu/view_menu_delegate.h"
#include "views/event.h"
+#include "views/screen.h"
#include "views/widget/root_view.h"
#include "views/widget/widget.h"
-
-#if defined(OS_WIN)
-#include "app/win_util.h"
-#endif
+#include "views/window/window.h"
using base::Time;
using base::TimeDelta;
@@ -105,25 +103,14 @@ void MenuButton::Paint(gfx::Canvas* canvas, bool for_drag) {
////////////////////////////////////////////////////////////////////////////////
int MenuButton::GetMaximumScreenXCoordinate() {
- Widget* widget = GetWidget();
-
- if (!widget) {
+ if (!GetWindow()) {
NOTREACHED();
return 0;
}
-#if defined(OS_WIN)
- HWND hwnd = widget->GetNativeView();
- RECT t;
- ::GetWindowRect(hwnd, &t);
-
- gfx::Rect r(t);
- gfx::Rect monitor_rect = win_util::GetMonitorBoundsForRect(r);
- return monitor_rect.x() + monitor_rect.width() - 1;
-#else
- NOTIMPLEMENTED();
- return 1000000;
-#endif
+ gfx::Rect monitor_bounds =
+ Screen::GetMonitorWorkAreaNearestWindow(GetWindow()->GetNativeWindow());
+ return monitor_bounds.right() - 1;
}
bool MenuButton::Activate() {
@@ -162,7 +149,7 @@ bool MenuButton::Activate() {
GetRootView()->SetMouseHandler(NULL);
menu_visible_ = true;
- menu_delegate_->RunMenu(this, menu_position, GetWidget()->GetNativeView());
+ menu_delegate_->RunMenu(this, menu_position);
menu_visible_ = false;
menu_closed_time_ = Time::Now();
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