| 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 "components/mus/view_tree_host_impl.h" | 5 #include "components/mus/view_tree_host_impl.h" |
| 6 | 6 |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "components/mus/connection_manager.h" | 8 #include "components/mus/connection_manager.h" |
| 9 #include "components/mus/display_manager.h" | 9 #include "components/mus/display_manager.h" |
| 10 #include "components/mus/focus_controller.h" | 10 #include "components/mus/focus_controller.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // can destroy the corresponding ViewTreeHostConnection, and |this|. So | 143 // can destroy the corresponding ViewTreeHostConnection, and |this|. So |
| 144 // setting it to nullptr afterwards in reset() ends up writing on free'd | 144 // setting it to nullptr afterwards in reset() ends up writing on free'd |
| 145 // memory. So transfer over to a local scoped_ptr<> before destroying it. | 145 // memory. So transfer over to a local scoped_ptr<> before destroying it. |
| 146 scoped_ptr<DisplayManager> temp = display_manager_.Pass(); | 146 scoped_ptr<DisplayManager> temp = display_manager_.Pass(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 ServerView* ViewTreeHostImpl::GetRootView() { | 149 ServerView* ViewTreeHostImpl::GetRootView() { |
| 150 return root_.get(); | 150 return root_.get(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 void ViewTreeHostImpl::OnEvent(mojo::EventPtr event) { | 153 void ViewTreeHostImpl::OnEvent(ViewId id, mojo::EventPtr event) { |
| 154 ServerView* view = connection_manager_->GetView(id); |
| 155 if (view) { |
| 156 DispatchInputEventToView(view, event.Pass()); |
| 157 return; |
| 158 } |
| 154 event_dispatcher_.OnEvent(event.Pass()); | 159 event_dispatcher_.OnEvent(event.Pass()); |
| 155 } | 160 } |
| 156 | 161 |
| 157 void ViewTreeHostImpl::OnDisplayClosed() { | 162 void ViewTreeHostImpl::OnDisplayClosed() { |
| 158 if (delegate_) | 163 if (delegate_) |
| 159 delegate_->OnDisplayClosed(); | 164 delegate_->OnDisplayClosed(); |
| 160 } | 165 } |
| 161 | 166 |
| 162 void ViewTreeHostImpl::OnViewportMetricsChanged( | 167 void ViewTreeHostImpl::OnViewportMetricsChanged( |
| 163 const mojo::ViewportMetrics& old_metrics, | 168 const mojo::ViewportMetrics& old_metrics, |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 root_tree != embedded_connection_old && | 237 root_tree != embedded_connection_old && |
| 233 root_tree != owning_connection_new && | 238 root_tree != owning_connection_new && |
| 234 root_tree != embedded_connection_new) { | 239 root_tree != embedded_connection_new) { |
| 235 root_tree->ProcessFocusChanged(old_focused_view, new_focused_view); | 240 root_tree->ProcessFocusChanged(old_focused_view, new_focused_view); |
| 236 } | 241 } |
| 237 | 242 |
| 238 UpdateTextInputState(new_focused_view, new_focused_view->text_input_state()); | 243 UpdateTextInputState(new_focused_view, new_focused_view->text_input_state()); |
| 239 } | 244 } |
| 240 | 245 |
| 241 } // namespace view_manager | 246 } // namespace view_manager |
| OLD | NEW |