Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ash/host/ash_window_tree_host_unified.h" | 5 #include "ash/host/ash_window_tree_host_unified.h" |
| 6 #include "ash/host/root_window_transformer.h" | 6 #include "ash/host/root_window_transformer.h" |
| 7 #include "ash/ime/input_method_event_handler.h" | 7 #include "ash/ime/input_method_event_handler.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 UnifiedEventTargeter(aura::Window* src_root, aura::Window* dst_root) | 21 UnifiedEventTargeter(aura::Window* src_root, aura::Window* dst_root) |
| 22 : src_root_(src_root), dst_root_(dst_root) {} | 22 : src_root_(src_root), dst_root_(dst_root) {} |
| 23 | 23 |
| 24 ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, | 24 ui::EventTarget* FindTargetForEvent(ui::EventTarget* root, |
| 25 ui::Event* event) override { | 25 ui::Event* event) override { |
| 26 if (root == src_root_ && !event->target()) { | 26 if (root == src_root_ && !event->target()) { |
| 27 if (event->IsLocatedEvent()) { | 27 if (event->IsLocatedEvent()) { |
| 28 ui::LocatedEvent* located_event = static_cast<ui::LocatedEvent*>(event); | 28 ui::LocatedEvent* located_event = static_cast<ui::LocatedEvent*>(event); |
| 29 located_event->ConvertLocationToTarget( | 29 located_event->ConvertLocationToTarget( |
| 30 static_cast<aura::Window*>(nullptr), dst_root_); | 30 static_cast<aura::Window*>(nullptr), dst_root_); |
| 31 located_event->UpdateForRootTransform( | |
| 32 dst_root_->GetHost()->GetRootTransform()); | |
|
oshima
2015/07/29 20:20:52
Event transform is handled in WindowEventDispatche
| |
| 33 } | 31 } |
| 34 ignore_result( | 32 ignore_result( |
| 35 dst_root_->GetHost()->event_processor()->OnEventFromSource(event)); | 33 dst_root_->GetHost()->event_processor()->OnEventFromSource(event)); |
| 36 return nullptr; | 34 return nullptr; |
| 37 } else { | 35 } else { |
| 38 NOTREACHED() << "event type:" << event->type(); | 36 NOTREACHED() << "event type:" << event->type(); |
| 39 return aura::WindowTargeter::FindTargetForEvent(root, event); | 37 return aura::WindowTargeter::FindTargetForEvent(root, event); |
| 40 } | 38 } |
| 41 } | 39 } |
| 42 | 40 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 } | 113 } |
| 116 | 114 |
| 117 void AshWindowTreeHostUnified::HideImpl() { | 115 void AshWindowTreeHostUnified::HideImpl() { |
| 118 } | 116 } |
| 119 | 117 |
| 120 gfx::Rect AshWindowTreeHostUnified::GetBounds() const { | 118 gfx::Rect AshWindowTreeHostUnified::GetBounds() const { |
| 121 return bounds_; | 119 return bounds_; |
| 122 } | 120 } |
| 123 | 121 |
| 124 void AshWindowTreeHostUnified::SetBounds(const gfx::Rect& bounds) { | 122 void AshWindowTreeHostUnified::SetBounds(const gfx::Rect& bounds) { |
| 125 if (bounds_.size() == bounds.size()) | |
| 126 return; | |
| 127 bounds_.set_size(bounds.size()); | 123 bounds_.set_size(bounds.size()); |
| 128 OnHostResized(bounds_.size()); | 124 OnHostResized(bounds_.size()); |
| 129 } | 125 } |
| 130 | 126 |
| 131 gfx::Transform AshWindowTreeHostUnified::GetRootTransform() const { | 127 gfx::Transform AshWindowTreeHostUnified::GetRootTransform() const { |
| 132 return transformer_helper_.GetTransform(); | 128 return transformer_helper_.GetTransform(); |
| 133 } | 129 } |
| 134 | 130 |
| 135 void AshWindowTreeHostUnified::SetRootTransform( | 131 void AshWindowTreeHostUnified::SetRootTransform( |
| 136 const gfx::Transform& transform) { | 132 const gfx::Transform& transform) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 input_method_handler()->SetPostIME(true); | 184 input_method_handler()->SetPostIME(true); |
| 189 ui::EventDispatchDetails details = | 185 ui::EventDispatchDetails details = |
| 190 event_processor()->OnEventFromSource(&event_copy); | 186 event_processor()->OnEventFromSource(&event_copy); |
| 191 if (details.dispatcher_destroyed) | 187 if (details.dispatcher_destroyed) |
| 192 return true; | 188 return true; |
| 193 input_method_handler()->SetPostIME(false); | 189 input_method_handler()->SetPostIME(false); |
| 194 return event_copy.stopped_propagation(); | 190 return event_copy.stopped_propagation(); |
| 195 } | 191 } |
| 196 | 192 |
| 197 } // namespace ash | 193 } // namespace ash |
| OLD | NEW |