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 "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/client/default_capture_client.h" | 10 #include "ui/aura/client/default_capture_client.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 void NativeWidgetViewManager::CompositorContentsChanged( | 132 void NativeWidgetViewManager::CompositorContentsChanged( |
133 const SkBitmap& bitmap) { | 133 const SkBitmap& bitmap) { |
134 if (view_) | 134 if (view_) |
135 view_->SetContents(bitmap); | 135 view_->SetContents(bitmap); |
136 } | 136 } |
137 | 137 |
138 void NativeWidgetViewManager::OnViewDestroyed(View* view) { | 138 void NativeWidgetViewManager::OnViewDestroyed(View* view) { |
139 DCHECK_EQ(view, view_); | 139 DCHECK_EQ(view, view_); |
140 view->RemoveObserver(this); | 140 view->RemoveObserver(this); |
141 view_ = NULL; | 141 view_ = NULL; |
142 window_tree_host_.reset(); | |
143 } | 142 } |
144 | 143 |
145 void NativeWidgetViewManager::OnViewBoundsChanged(View* view, | 144 void NativeWidgetViewManager::OnViewBoundsChanged(View* view, |
146 const gfx::Rect& old_bounds, | 145 const gfx::Rect& old_bounds, |
147 const gfx::Rect& new_bounds) { | 146 const gfx::Rect& new_bounds) { |
148 GetWidget()->SetBounds(gfx::Rect(view->bounds().size())); | 147 GetWidget()->SetBounds(gfx::Rect(view->bounds().size())); |
149 } | 148 } |
150 | 149 |
151 void NativeWidgetViewManager::OnViewInputEvent(View* view, | 150 void NativeWidgetViewManager::OnViewInputEvent(View* view, |
152 const EventPtr& event) { | 151 const EventPtr& event) { |
153 scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event> >()); | 152 scoped_ptr<ui::Event> ui_event(event.To<scoped_ptr<ui::Event> >()); |
154 if (ui_event) | 153 if (ui_event) |
155 window_tree_host_->SendEventToProcessor(ui_event.get()); | 154 window_tree_host_->SendEventToProcessor(ui_event.get()); |
156 } | 155 } |
157 | 156 |
158 } // namespace mojo | 157 } // namespace mojo |
OLD | NEW |