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

Side by Side Diff: ui/aura/test/ui_controls_factory_aurax11.cc

Issue 223483002: base: Do not allow MessagePumpObservers to consume events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r262009 Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/device_list_updater_aurax11.cc ('k') | ui/aura/window_tree_host_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <X11/keysym.h> 5 #include <X11/keysym.h>
6 #include <X11/Xlib.h> 6 #include <X11/Xlib.h>
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "ui/aura/client/screen_position_client.h" 9 #include "ui/aura/client/screen_position_client.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 : closure_(closure), 42 : closure_(closure),
43 matcher_(matcher) { 43 matcher_(matcher) {
44 base::MessageLoopForUI::current()->AddObserver(this); 44 base::MessageLoopForUI::current()->AddObserver(this);
45 } 45 }
46 46
47 virtual ~EventWaiter() { 47 virtual ~EventWaiter() {
48 base::MessageLoopForUI::current()->RemoveObserver(this); 48 base::MessageLoopForUI::current()->RemoveObserver(this);
49 } 49 }
50 50
51 // MessageLoop::Observer implementation: 51 // MessageLoop::Observer implementation:
52 virtual base::EventStatus WillProcessEvent( 52 virtual void WillProcessEvent(const base::NativeEvent& event) OVERRIDE {
53 const base::NativeEvent& event) OVERRIDE {
54 if ((*matcher_)(event)) { 53 if ((*matcher_)(event)) {
55 base::MessageLoop::current()->PostTask(FROM_HERE, closure_); 54 base::MessageLoop::current()->PostTask(FROM_HERE, closure_);
56 delete this; 55 delete this;
57 } 56 }
58 return base::EVENT_CONTINUE;
59 } 57 }
60 58
61 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE { 59 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE {
62 } 60 }
63 61
64 private: 62 private:
65 base::Closure closure_; 63 base::Closure closure_;
66 EventWaiterMatcher matcher_; 64 EventWaiterMatcher matcher_;
67 DISALLOW_COPY_AND_ASSIGN(EventWaiter); 65 DISALLOW_COPY_AND_ASSIGN(EventWaiter);
68 }; 66 };
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 }; 254 };
257 255
258 } // namespace 256 } // namespace
259 257
260 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) { 258 UIControlsAura* CreateUIControlsAura(WindowTreeHost* host) {
261 return new UIControlsX11(host); 259 return new UIControlsX11(host);
262 } 260 }
263 261
264 } // namespace test 262 } // namespace test
265 } // namespace aura 263 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/device_list_updater_aurax11.cc ('k') | ui/aura/window_tree_host_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698