| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |