Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Unified Diff: views/controls/menu/native_menu_win.cc

Issue 6336014: Fix printing PDFs through right click on Mac and Linux. Looks like they both... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/models/simple_menu_model.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/native_menu_win.cc
===================================================================
--- views/controls/menu/native_menu_win.cc (revision 72573)
+++ views/controls/menu/native_menu_win.cc (working copy)
@@ -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 @@
// 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 @@
SetTextColor(dc, prev_text_color);
}
- void OnMenuClosed() {
- parent_->model_->MenuClosed();
- }
-
bool ProcessWindowMessage(HWND window,
UINT message,
WPARAM w_param,
@@ -274,12 +266,7 @@
*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 @@
HWND hwnd_;
NativeMenuWin* parent_;
- ScopedRunnableMethodFactory<MenuHostWindow> method_factory_;
DISALLOW_COPY_AND_ASSIGN(MenuHostWindow);
};
« no previous file with comments | « ui/base/models/simple_menu_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698