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

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

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit Created 5 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
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/window_manager/view_target.h"
8 #include "third_party/mojo_services/src/view_manager/public/cpp/view.h"
9
10 namespace window_manager {
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 }
29
30 bool ViewEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) {
31 return event_dispatch_target_ == target;
32 }
33
34 ui::EventDispatchDetails ViewEventDispatcher::PreDispatchEvent(
35 ui::EventTarget* target,
36 ui::Event* event) {
37 // TODO(erg): PreDispatch in aura::WindowEventDispatcher does many, many
38 // things. It, and the functions split off for different event types, are
39 // most of the file.
40 old_dispatch_target_ = event_dispatch_target_;
41 event_dispatch_target_ = static_cast<ViewTarget*>(target);
42 return ui::EventDispatchDetails();
43 }
44
45 ui::EventDispatchDetails ViewEventDispatcher::PostDispatchEvent(
46 ui::EventTarget* target,
47 const ui::Event& event) {
48 // TODO(erg): Not at all as long as PreDispatchEvent, but still missing core
49 // details.
50 event_dispatch_target_ = old_dispatch_target_;
51 old_dispatch_target_ = nullptr;
52 return ui::EventDispatchDetails();
53 }
54
55 } // namespace window_manager
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