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

Side by Side Diff: mojo/services/window_manager/view_event_dispatcher.cc

Issue 765753003: Move window_manager service implementation to //services (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "mojo/services/window_manager/view_event_dispatcher.h"
6
7 #include "mojo/services/public/cpp/view_manager/view.h"
8 #include "mojo/services/window_manager/view_target.h"
9
10 namespace mojo {
11
12 ViewEventDispatcher::ViewEventDispatcher()
13 : event_dispatch_target_(nullptr),
14 old_dispatch_target_(nullptr) {
15 }
16
17 ViewEventDispatcher::~ViewEventDispatcher() {}
18
19 void ViewEventDispatcher::SetRootViewTarget(ViewTarget* root_view_target) {
20 root_view_target_ = root_view_target;
21 }
22
23 ui::EventTarget* ViewEventDispatcher::GetRootTarget() {
24 return root_view_target_;
25 }
26
27 void ViewEventDispatcher::OnEventProcessingStarted(ui::Event* event) {
28 // TODO(erg): In the aura version of this class, we perform a DIP based
29 // transformation here. Do we want to do any sort of analogous transformation
30 // here.
31 }
32
33 bool ViewEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) {
34 return event_dispatch_target_ == target;
35 }
36
37 ui::EventDispatchDetails ViewEventDispatcher::PreDispatchEvent(
38 ui::EventTarget* target,
39 ui::Event* event) {
40 // TODO(erg): PreDispatch in aura::WindowEventDispatcher does many, many
41 // things. It, and the functions split off for different event types, are
42 // most of the file.
43 old_dispatch_target_ = event_dispatch_target_;
44 event_dispatch_target_ = static_cast<ViewTarget*>(target);
45 return ui::EventDispatchDetails();
46 }
47
48 ui::EventDispatchDetails ViewEventDispatcher::PostDispatchEvent(
49 ui::EventTarget* target,
50 const ui::Event& event) {
51 // TODO(erg): Not at all as long as PreDispatchEvent, but still missing core
52 // details.
53 event_dispatch_target_ = old_dispatch_target_;
54 old_dispatch_target_ = nullptr;
55 return ui::EventDispatchDetails();
56 }
57
58 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/window_manager/view_event_dispatcher.h ('k') | mojo/services/window_manager/view_target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698