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

Unified Diff: ui/base/models/simple_menu_model.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.h ('k') | views/controls/menu/native_menu_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/models/simple_menu_model.cc
===================================================================
--- ui/base/models/simple_menu_model.cc (revision 72573)
+++ ui/base/models/simple_menu_model.cc (working copy)
@@ -4,6 +4,7 @@
#include "ui/base/models/simple_menu_model.h"
+#include "base/message_loop.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
@@ -51,7 +52,9 @@
////////////////////////////////////////////////////////////////////////////////
// SimpleMenuModel, public:
-SimpleMenuModel::SimpleMenuModel(Delegate* delegate) : delegate_(delegate) {
+SimpleMenuModel::SimpleMenuModel(Delegate* delegate)
+ : delegate_(delegate),
+ ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
}
SimpleMenuModel::~SimpleMenuModel() {
@@ -288,6 +291,15 @@
}
void SimpleMenuModel::MenuClosed() {
+ // Due to how menus work on the different platforms, ActivatedAt will be
+ // called after this. It's more convenient for the delegate to be called
+ // afterwards though, so post a task.
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ method_factory_.NewRunnableMethod(&SimpleMenuModel::OnMenuClosed));
+}
+
+void SimpleMenuModel::OnMenuClosed() {
if (delegate_)
delegate_->MenuClosed();
}
« no previous file with comments | « ui/base/models/simple_menu_model.h ('k') | views/controls/menu/native_menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698