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

Side by Side Diff: ui/display/chromeos/x11/native_display_event_dispatcher_x11.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 "base/time/default_tick_clock.h" 5 #include "base/time/default_tick_clock.h"
6 #include "ui/display/chromeos/x11/native_display_event_dispatcher_x11.h" 6 #include "ui/display/chromeos/x11/native_display_event_dispatcher_x11.h"
7 #include "ui/display/chromeos/x11/display_mode_x11.h" 7 #include "ui/display/chromeos/x11/display_mode_x11.h"
8 #include "ui/display/chromeos/x11/display_snapshot_x11.h" 8 #include "ui/display/chromeos/x11/display_snapshot_x11.h"
9 #include "ui/events/platform/platform_event_source.h" 9 #include "ui/events/platform/platform_event_source.h"
10 10
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 NativeDisplayEventDispatcherX11::~NativeDisplayEventDispatcherX11() {} 27 NativeDisplayEventDispatcherX11::~NativeDisplayEventDispatcherX11() {}
28 28
29 bool NativeDisplayEventDispatcherX11::CanDispatchEvent( 29 bool NativeDisplayEventDispatcherX11::CanDispatchEvent(
30 const PlatformEvent& event) { 30 const PlatformEvent& event) {
31 return (event->type - xrandr_event_base_ == RRScreenChangeNotify) || 31 return (event->type - xrandr_event_base_ == RRScreenChangeNotify) ||
32 (event->type - xrandr_event_base_ == RRNotify); 32 (event->type - xrandr_event_base_ == RRNotify);
33 } 33 }
34 34
35 uint32_t NativeDisplayEventDispatcherX11::DispatchEvent( 35 ui::PostDispatchAction NativeDisplayEventDispatcherX11::DispatchEvent(
36 const PlatformEvent& event) { 36 const PlatformEvent& event) {
37 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) { 37 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) {
38 VLOG(1) << "Received RRScreenChangeNotify event"; 38 VLOG(1) << "Received RRScreenChangeNotify event";
39 delegate_->UpdateXRandRConfiguration(event); 39 delegate_->UpdateXRandRConfiguration(event);
40 return ui::POST_DISPATCH_PERFORM_DEFAULT; 40 return ui::POST_DISPATCH_PERFORM_DEFAULT;
41 } 41 }
42 42
43 // Bail out early for everything except RRNotify_OutputChange events 43 // Bail out early for everything except RRNotify_OutputChange events
44 // about an output getting connected or disconnected. 44 // about an output getting connected or disconnected.
45 if (event->type - xrandr_event_base_ != RRNotify) 45 if (event->type - xrandr_event_base_ != RRNotify)
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return ui::POST_DISPATCH_PERFORM_DEFAULT; 98 return ui::POST_DISPATCH_PERFORM_DEFAULT;
99 } 99 }
100 100
101 void NativeDisplayEventDispatcherX11::SetTickClockForTest( 101 void NativeDisplayEventDispatcherX11::SetTickClockForTest(
102 scoped_ptr<base::TickClock> tick_clock) { 102 scoped_ptr<base::TickClock> tick_clock) {
103 tick_clock_ = tick_clock.Pass(); 103 tick_clock_ = tick_clock.Pass();
104 startup_time_ = tick_clock_->NowTicks(); 104 startup_time_ = tick_clock_->NowTicks();
105 } 105 }
106 106
107 } // namespace ui 107 } // namespace ui
OLDNEW
« no previous file with comments | « ui/display/chromeos/x11/native_display_event_dispatcher_x11.h ('k') | ui/events/platform/platform_event_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698