summaryrefslogtreecommitdiffstats
path: root/cloud_print/service/win
diff options
context:
space:
mode:
authoryukawa@chromium.org <yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-07 09:16:23 +0000
committeryukawa@chromium.org <yukawa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-07 09:16:23 +0000
commit62a0940d013c5a38adb4a6043f63669ca5e01dc4 (patch)
tree75119cff6919966263a598456d1b447c764e0603 /cloud_print/service/win
parent98fa43449e44fb1472383f44b8c12a4747b6147f (diff)
downloadchromium_src-62a0940d013c5a38adb4a6043f63669ca5e01dc4.zip
chromium_src-62a0940d013c5a38adb4a6043f63669ca5e01dc4.tar.gz
chromium_src-62a0940d013c5a38adb4a6043f63669ca5e01dc4.tar.bz2
Revert "Revert 249234 "Use MessagePumpDispatcher instead of MessageFilter""
This reverts commit 33c0f57d77e38a009034fb7d0e905755d9620035 with a trivial modification to corp with a recent refactoring committed as r249105. BUG=330735, 319122 Review URL: https://codereview.chromium.org/143503004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249650 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print/service/win')
-rw-r--r--cloud_print/service/win/cloud_print_service_config.cc26
1 files changed, 15 insertions, 11 deletions
diff --git a/cloud_print/service/win/cloud_print_service_config.cc b/cloud_print/service/win/cloud_print_service_config.cc
index d622e64..58fcacc 100644
--- a/cloud_print/service/win/cloud_print_service_config.cc
+++ b/cloud_print/service/win/cloud_print_service_config.cc
@@ -11,6 +11,8 @@
#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"
@@ -29,15 +31,19 @@ class SetupDialog : public base::RefCounted<SetupDialog>,
public ATL::CDialogImpl<SetupDialog> {
public:
// Enables accelerators.
- class MessageFilter : public base::MessageLoopForUI::MessageFilter {
+ class Dispatcher : public base::MessagePumpDispatcher {
public:
- explicit MessageFilter(SetupDialog* dialog) : dialog_(dialog){}
- virtual ~MessageFilter() {};
+ explicit Dispatcher(SetupDialog* dialog) : dialog_(dialog) {}
+ virtual ~Dispatcher() {};
- // MessageLoopForUI::MessageFilter
- virtual bool ProcessMessage(const MSG& msg) OVERRIDE {
+ // MessagePumpDispatcher:
+ virtual bool Dispatch(const MSG& msg) OVERRIDE {
MSG msg2 = msg;
- return dialog_->IsDialogMessage(&msg2) != FALSE;
+ if (!dialog_->IsDialogMessage(&msg2)) {
+ ::TranslateMessage(&msg);
+ ::DispatchMessage(&msg);
+ }
+ return true;
}
private:
@@ -444,10 +450,8 @@ int WINAPI WinMain(__in HINSTANCE hInstance,
scoped_refptr<SetupDialog> dialog(new SetupDialog());
dialog->Create(NULL);
dialog->ShowWindow(SW_SHOW);
- scoped_ptr<SetupDialog::MessageFilter> filter(
- new SetupDialog::MessageFilter(dialog));
- loop.SetMessageFilter(filter.Pass());
-
- loop.Run();
+ SetupDialog::Dispatcher dispatcher(dialog);
+ base::RunLoop run_loop(&dispatcher);
+ run_loop.Run();
return 0;
}