| OLD | NEW |
| 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 "mojo/services/window_manager/view_event_dispatcher.h" | 5 #include "mojo/services/window_manager/view_event_dispatcher.h" |
| 6 | 6 |
| 7 #include "mojo/services/public/cpp/view_manager/view.h" |
| 7 #include "mojo/services/window_manager/view_target.h" | 8 #include "mojo/services/window_manager/view_target.h" |
| 8 | 9 |
| 9 namespace mojo { | 10 namespace mojo { |
| 10 | 11 |
| 11 ViewEventDispatcher::ViewEventDispatcher() | 12 ViewEventDispatcher::ViewEventDispatcher() |
| 12 : event_dispatch_target_(nullptr), | 13 : event_dispatch_target_(nullptr), |
| 13 old_dispatch_target_(nullptr) { | 14 old_dispatch_target_(nullptr) { |
| 14 } | 15 } |
| 15 | 16 |
| 16 ViewEventDispatcher::~ViewEventDispatcher() {} | 17 ViewEventDispatcher::~ViewEventDispatcher() {} |
| 17 | 18 |
| 18 void ViewEventDispatcher::SetRootViewTarget(ViewTarget* root_view_target) { | 19 void ViewEventDispatcher::SetRootViewTarget(ViewTarget* root_view_target) { |
| 19 root_view_target_.reset(root_view_target); | 20 root_view_target_ = root_view_target; |
| 20 } | 21 } |
| 21 | 22 |
| 22 ui::EventTarget* ViewEventDispatcher::GetRootTarget() { | 23 ui::EventTarget* ViewEventDispatcher::GetRootTarget() { |
| 23 return root_view_target_.get(); | 24 return root_view_target_; |
| 24 } | 25 } |
| 25 | 26 |
| 26 void ViewEventDispatcher::OnEventProcessingStarted(ui::Event* event) { | 27 void ViewEventDispatcher::OnEventProcessingStarted(ui::Event* event) { |
| 27 // TODO(erg): In the aura version of this class, we perform a DIP based | 28 // TODO(erg): In the aura version of this class, we perform a DIP based |
| 28 // transformation here. Do we want to do any sort of analogous transformation | 29 // transformation here. Do we want to do any sort of analogous transformation |
| 29 // here. | 30 // here. |
| 30 } | 31 } |
| 31 | 32 |
| 32 bool ViewEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) { | 33 bool ViewEventDispatcher::CanDispatchToTarget(ui::EventTarget* target) { |
| 33 return event_dispatch_target_ == target; | 34 return event_dispatch_target_ == target; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 48 ui::EventTarget* target, | 49 ui::EventTarget* target, |
| 49 const ui::Event& event) { | 50 const ui::Event& event) { |
| 50 // TODO(erg): Not at all as long as PreDispatchEvent, but still missing core | 51 // TODO(erg): Not at all as long as PreDispatchEvent, but still missing core |
| 51 // details. | 52 // details. |
| 52 event_dispatch_target_ = old_dispatch_target_; | 53 event_dispatch_target_ = old_dispatch_target_; |
| 53 old_dispatch_target_ = nullptr; | 54 old_dispatch_target_ = nullptr; |
| 54 return ui::EventDispatchDetails(); | 55 return ui::EventDispatchDetails(); |
| 55 } | 56 } |
| 56 | 57 |
| 57 } // namespace mojo | 58 } // namespace mojo |
| OLD | NEW |