| 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/converters/geometry/geometry_type_converters.h" |
| 8 #include "mojo/converters/input_events/input_events_type_converters.h" | 9 #include "mojo/converters/input_events/input_events_type_converters.h" |
| 9 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| 10 #include "ui/aura/client/default_capture_client.h" | 11 #include "ui/aura/client/default_capture_client.h" |
| 11 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 12 #include "ui/aura/window_event_dispatcher.h" | 13 #include "ui/aura/window_event_dispatcher.h" |
| 13 #include "ui/base/ime/input_method.h" | 14 #include "ui/base/ime/input_method.h" |
| 14 #include "ui/base/ime/input_method_base.h" | 15 #include "ui/base/ime/input_method_base.h" |
| 15 #include "ui/base/ime/input_method_delegate.h" | 16 #include "ui/base/ime/input_method_delegate.h" |
| 16 #include "ui/base/ime/input_method_factory.h" | 17 #include "ui/base/ime/input_method_factory.h" |
| 17 #include "ui/base/ime/text_input_client.h" | 18 #include "ui/base/ime/text_input_client.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 133 |
| 133 void NativeWidgetViewManager::OnViewDestroyed(View* view) { | 134 void NativeWidgetViewManager::OnViewDestroyed(View* view) { |
| 134 DCHECK_EQ(view, view_); | 135 DCHECK_EQ(view, view_); |
| 135 view->RemoveObserver(this); | 136 view->RemoveObserver(this); |
| 136 view_ = NULL; | 137 view_ = NULL; |
| 137 // TODO(sky): WindowTreeHostMojo assumes the View outlives it. | 138 // TODO(sky): WindowTreeHostMojo assumes the View outlives it. |
| 138 // NativeWidgetViewManager needs to deal, likely by deleting this. | 139 // NativeWidgetViewManager needs to deal, likely by deleting this. |
| 139 } | 140 } |
| 140 | 141 |
| 141 void NativeWidgetViewManager::OnViewBoundsChanged(View* view, | 142 void NativeWidgetViewManager::OnViewBoundsChanged(View* view, |
| 142 const gfx::Rect& old_bounds, | 143 const Rect& old_bounds, |
| 143 const gfx::Rect& new_bounds) { | 144 const Rect& new_bounds) { |
| 144 GetWidget()->SetBounds(gfx::Rect(view->bounds().size())); | 145 gfx::Rect view_rect = view->bounds().To<gfx::Rect>(); |
| 146 GetWidget()->SetBounds(gfx::Rect(view_rect.size())); |
| 145 } | 147 } |
| 146 | 148 |
| 147 void NativeWidgetViewManager::OnViewInputEvent(View* view, | 149 void NativeWidgetViewManager::OnViewInputEvent(View* view, |
| 148 const EventPtr& event) { | 150 const EventPtr& event) { |
| 149 scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event> >()); | 151 scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event> >()); |
| 150 if (ui_event) | 152 if (ui_event) |
| 151 window_tree_host_->SendEventToProcessor(ui_event.get()); | 153 window_tree_host_->SendEventToProcessor(ui_event.get()); |
| 152 } | 154 } |
| 153 | 155 |
| 154 } // namespace mojo | 156 } // namespace mojo |
| OLD | NEW |