diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-21 16:54:50 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-21 16:54:50 +0000 |
commit | c642dbbd4b8d3c44cf6092b0b8ecfab2be8992e5 (patch) | |
tree | c36eaad8f67fface68c71a0d292eedc151438e52 /views/controls | |
parent | b964e3589f3127be36cddf3deade64f00e2afc2c (diff) | |
download | chromium_src-c642dbbd4b8d3c44cf6092b0b8ecfab2be8992e5.zip chromium_src-c642dbbd4b8d3c44cf6092b0b8ecfab2be8992e5.tar.gz chromium_src-c642dbbd4b8d3c44cf6092b0b8ecfab2be8992e5.tar.bz2 |
Add CreateParams to Widget, and replace CreatePopupWidget with CreateParams.
BUG=72040
TEST=none
Review URL: http://codereview.chromium.org/6712008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/menu/menu_host_gtk.cc | 4 | ||||
-rw-r--r-- | views/controls/menu/menu_host_win.cc | 16 | ||||
-rw-r--r-- | views/controls/textfield/native_textfield_views_unittest.cc | 8 |
3 files changed, 11 insertions, 17 deletions
diff --git a/views/controls/menu/menu_host_gtk.cc b/views/controls/menu/menu_host_gtk.cc index 8679490..5552fbe 100644 --- a/views/controls/menu/menu_host_gtk.cc +++ b/views/controls/menu/menu_host_gtk.cc @@ -40,6 +40,10 @@ MenuHostGtk::MenuHostGtk(SubmenuView* submenu) } gdk_event_free(event); } + CreateParams params; + params.type = CreateParams::TYPE_MENU; + params.has_dropshadow = true; + SetCreateParams(params); } MenuHostGtk::~MenuHostGtk() { diff --git a/views/controls/menu/menu_host_win.cc b/views/controls/menu/menu_host_win.cc index 1beda38..3e77287 100644 --- a/views/controls/menu/menu_host_win.cc +++ b/views/controls/menu/menu_host_win.cc @@ -21,18 +21,10 @@ MenuHostWin::MenuHostWin(SubmenuView* submenu) : destroying_(false), submenu_(submenu), owns_capture_(false) { - set_window_style(WS_POPUP); - set_initial_class_style( - (base::win::GetVersion() < base::win::VERSION_XP) ? - 0 : CS_DROPSHADOW); - is_mouse_down_ = - ((GetKeyState(VK_LBUTTON) & 0x80) || - (GetKeyState(VK_RBUTTON) & 0x80) || - (GetKeyState(VK_MBUTTON) & 0x80) || - (GetKeyState(VK_XBUTTON1) & 0x80) || - (GetKeyState(VK_XBUTTON2) & 0x80)); - // Mouse clicks shouldn't give us focus. - set_window_ex_style(WS_EX_TOPMOST | WS_EX_NOACTIVATE); + CreateParams params; + params.type = CreateParams::TYPE_MENU; + params.has_dropshadow = true; + SetCreateParams(params); } MenuHostWin::~MenuHostWin() { diff --git a/views/controls/textfield/native_textfield_views_unittest.cc b/views/controls/textfield/native_textfield_views_unittest.cc index b284e6e..417a4b9 100644 --- a/views/controls/textfield/native_textfield_views_unittest.cc +++ b/views/controls/textfield/native_textfield_views_unittest.cc @@ -76,11 +76,9 @@ class NativeTextfieldViewsTest : public ViewsTestBase, ASSERT_FALSE(textfield_); textfield_ = new Textfield(style); textfield_->SetController(this); - widget_ = Widget::CreatePopupWidget( - Widget::NotTransparent, - Widget::AcceptEvents, - Widget::DeleteOnDestroy, - Widget::DontMirrorOriginInRTL); + Widget::CreateParams params(Widget::CreateParams::TYPE_POPUP); + params.mirror_origin_in_rtl = false; + widget_ = Widget::CreatePopupWidget(params); widget_->Init(NULL, gfx::Rect(100, 100, 100, 100)); View* container = new View(); widget_->SetContentsView(container); |