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

Unified Diff: trunk/src/cloud_print/service/win/cloud_print_service_config.cc

Issue 150283005: Revert 249234 "Use MessagePumpDispatcher instead of MessageFilter" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/cloud_print/service/win/cloud_print_service_config.cc
===================================================================
--- trunk/src/cloud_print/service/win/cloud_print_service_config.cc (revision 249267)
+++ trunk/src/cloud_print/service/win/cloud_print_service_config.cc (working copy)
@@ -11,8 +11,6 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/message_loop/message_loop.h"
-#include "base/message_loop/message_pump_dispatcher.h"
-#include "base/run_loop.h"
#include "base/strings/string16.h"
#include "base/threading/thread.h"
#include "chrome/common/chrome_constants.h"
@@ -31,19 +29,15 @@
public ATL::CDialogImpl<SetupDialog> {
public:
// Enables accelerators.
- class Dispatcher : public base::MessagePumpDispatcher {
+ class MessageFilter : public base::MessageLoopForUI::MessageFilter {
public:
- explicit Dispatcher(SetupDialog* dialog) : dialog_(dialog) {}
- virtual ~Dispatcher() {};
+ explicit MessageFilter(SetupDialog* dialog) : dialog_(dialog){}
+ virtual ~MessageFilter() {};
- // MessagePumpDispatcher:
- virtual bool Dispatch(const MSG& msg) OVERRIDE {
+ // MessageLoopForUI::MessageFilter
+ virtual bool ProcessMessage(const MSG& msg) OVERRIDE {
MSG msg2 = msg;
- if (!dialog_->IsDialogMessage(&msg2)) {
- ::TranslateMessage(&msg);
- ::DispatchMessage(&msg);
- }
- return true;
+ return dialog_->IsDialogMessage(&msg2) != FALSE;
}
private:
@@ -450,9 +444,10 @@
scoped_refptr<SetupDialog> dialog(new SetupDialog());
dialog->Create(NULL);
dialog->ShowWindow(SW_SHOW);
- SetupDialog::Dispatcher dispatcher(dialog);
- base::RunLoop run_loop;
- run_loop.set_dispatcher(&dispatcher);
- run_loop.Run();
+ scoped_ptr<SetupDialog::MessageFilter> filter(
+ new SetupDialog::MessageFilter(dialog));
+ loop.SetMessageFilter(filter.Pass());
+
+ loop.Run();
return 0;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698