diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 18:34:57 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-27 18:34:57 +0000 |
commit | efcebf36e26bbde3d2bdd774f65a9a15ba99c36a (patch) | |
tree | 3199448086a95953a3d2079b97c0779defc8f84f /views | |
parent | 9cae4ee1c9b2c13ad9f87a160f76d78ebe45e1a9 (diff) | |
download | chromium_src-efcebf36e26bbde3d2bdd774f65a9a15ba99c36a.zip chromium_src-efcebf36e26bbde3d2bdd774f65a9a15ba99c36a.tar.gz chromium_src-efcebf36e26bbde3d2bdd774f65a9a15ba99c36a.tar.bz2 |
Fix printing PDFs through right click on Mac and Linux. Looks like they both give the menu closed notification before the notification about which item was clicked.
BUG=70987
Review URL: http://codereview.chromium.org/6336014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72840 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/menu/native_menu_win.cc | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/views/controls/menu/native_menu_win.cc b/views/controls/menu/native_menu_win.cc index fab94b2..e7238a4 100644 --- a/views/controls/menu/native_menu_win.cc +++ b/views/controls/menu/native_menu_win.cc @@ -5,9 +5,7 @@ #include "views/controls/menu/native_menu_win.h" #include "base/logging.h" -#include "base/message_loop.h" #include "base/stl_util-inl.h" -#include "base/task.h" #include "gfx/canvas_skia.h" #include "gfx/font.h" #include "third_party/skia/include/core/SkBitmap.h" @@ -54,9 +52,7 @@ struct NativeMenuWin::ItemData { // structure we have constructed in NativeMenuWin. class NativeMenuWin::MenuHostWindow { public: - MenuHostWindow(NativeMenuWin* parent) - : parent_(parent), - ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { + MenuHostWindow(NativeMenuWin* parent) : parent_(parent) { RegisterClass(); hwnd_ = CreateWindowEx(l10n_util::GetExtendedStyles(), kWindowClassName, L"", 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL); @@ -247,10 +243,6 @@ class NativeMenuWin::MenuHostWindow { SetTextColor(dc, prev_text_color); } - void OnMenuClosed() { - parent_->model_->MenuClosed(); - } - bool ProcessWindowMessage(HWND window, UINT message, WPARAM w_param, @@ -274,12 +266,7 @@ class NativeMenuWin::MenuHostWindow { *l_result = 0; return true; case WM_EXITMENULOOP: - // WM_MENUCOMMAND comes after this message, but still in the same - // callstack. So use PostTask to guarantee that we'll tell the model - // that the menus is closed after any other notifications. - MessageLoop::current()->PostTask( - FROM_HERE, - method_factory_.NewRunnableMethod(&MenuHostWindow::OnMenuClosed)); + parent_->model_->MenuClosed(); return true; // TODO(beng): bring over owner draw from old menu system. } @@ -303,7 +290,6 @@ class NativeMenuWin::MenuHostWindow { HWND hwnd_; NativeMenuWin* parent_; - ScopedRunnableMethodFactory<MenuHostWindow> method_factory_; DISALLOW_COPY_AND_ASSIGN(MenuHostWindow); }; |