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

Side by Side Diff: ui/views/test/x11_property_change_waiter.cc

Issue 667823002: PlatformEventDispatcher::DispatchEvent() should return a PostDispatchAction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ui_enums
Patch Set: Fix platform_event_source_unittest.cc Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/views/test/x11_property_change_waiter.h" 5 #include "ui/views/test/x11_property_change_waiter.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 8
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "ui/events/platform/platform_event_source.h" 10 #include "ui/events/platform/platform_event_source.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const ui::PlatformEvent& event) { 58 const ui::PlatformEvent& event) {
59 // Stop waiting once we get a property change. 59 // Stop waiting once we get a property change.
60 return true; 60 return true;
61 } 61 }
62 62
63 bool X11PropertyChangeWaiter::CanDispatchEvent(const ui::PlatformEvent& event) { 63 bool X11PropertyChangeWaiter::CanDispatchEvent(const ui::PlatformEvent& event) {
64 NOTREACHED(); 64 NOTREACHED();
65 return true; 65 return true;
66 } 66 }
67 67
68 uint32_t X11PropertyChangeWaiter::DispatchEvent( 68 ui::PostDispatchAction X11PropertyChangeWaiter::DispatchEvent(
69 const ui::PlatformEvent& event) { 69 const ui::PlatformEvent& event) {
70 if (!wait_ || 70 if (!wait_ ||
71 event->type != PropertyNotify || 71 event->type != PropertyNotify ||
72 event->xproperty.window != x_window_ || 72 event->xproperty.window != x_window_ ||
73 event->xproperty.atom != atom_cache_->GetAtom(property_) || 73 event->xproperty.atom != atom_cache_->GetAtom(property_) ||
74 ShouldKeepOnWaiting(event)) { 74 ShouldKeepOnWaiting(event)) {
75 return ui::POST_DISPATCH_PERFORM_DEFAULT; 75 return ui::POST_DISPATCH_PERFORM_DEFAULT;
76 } 76 }
77 77
78 wait_ = false; 78 wait_ = false;
79 if (!quit_closure_.is_null()) 79 if (!quit_closure_.is_null())
80 quit_closure_.Run(); 80 quit_closure_.Run();
81 return ui::POST_DISPATCH_PERFORM_DEFAULT; 81 return ui::POST_DISPATCH_PERFORM_DEFAULT;
82 } 82 }
83 83
84 } // namespace views 84 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/test/x11_property_change_waiter.h ('k') | ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698