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/views/native_widget_view_manager.h" | 5 #include "mojo/views/native_widget_view_manager.h" |
6 | 6 |
7 #include "mojo/aura/window_tree_host_mojo.h" | 7 #include "mojo/aura/window_tree_host_mojo.h" |
8 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" | 8 #include "mojo/services/public/cpp/input_events/input_events_type_converters.h" |
9 #include "mojo/services/public/cpp/view_manager/view.h" | 9 #include "mojo/services/public/cpp/view_manager/view.h" |
10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 if (old_view) | 155 if (old_view) |
156 old_view->RemoveObserver(this); | 156 old_view->RemoveObserver(this); |
157 if (new_view) | 157 if (new_view) |
158 new_view->AddObserver(this); | 158 new_view->AddObserver(this); |
159 view_ = new_view; | 159 view_ = new_view; |
160 } | 160 } |
161 | 161 |
162 void NativeWidgetViewManager::OnViewInputEvent(view_manager::View* view, | 162 void NativeWidgetViewManager::OnViewInputEvent(view_manager::View* view, |
163 const EventPtr& event) { | 163 const EventPtr& event) { |
164 scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event> >()); | 164 scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event> >()); |
165 if (ui_event.get()) | 165 if (ui_event) |
166 window_tree_host_->SendEventToProcessor(ui_event.get()); | 166 window_tree_host_->SendEventToProcessor(ui_event.get()); |
167 } | 167 } |
168 | 168 |
169 void NativeWidgetViewManager::OnViewDestroyed(view_manager::View* view) { | 169 void NativeWidgetViewManager::OnViewDestroyed(view_manager::View* view) { |
170 DCHECK_EQ(view, view_); | 170 DCHECK_EQ(view, view_); |
171 view->RemoveObserver(this); | 171 view->RemoveObserver(this); |
172 view_ = NULL; | 172 view_ = NULL; |
173 } | 173 } |
174 | 174 |
175 } // namespace mojo | 175 } // namespace mojo |
OLD | NEW |