OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/services/view_manager/window_tree_host_impl.h" | 5 #include "mojo/services/view_manager/window_tree_host_impl.h" |
6 | 6 |
7 #include "mojo/public/c/gles2/gles2.h" | 7 #include "mojo/public/c/gles2/gles2.h" |
8 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" | 8 #include "mojo/services/public/cpp/geometry/geometry_type_converters.h" |
9 #include "mojo/services/view_manager/context_factory_impl.h" | 9 #include "mojo/services/view_manager/context_factory_impl.h" |
10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 //////////////////////////////////////////////////////////////////////////////// | 129 //////////////////////////////////////////////////////////////////////////////// |
130 // WindowTreeHostImpl, NativeViewportClient implementation: | 130 // WindowTreeHostImpl, NativeViewportClient implementation: |
131 | 131 |
132 void WindowTreeHostImpl::OnCreated() { | 132 void WindowTreeHostImpl::OnCreated() { |
133 CreateCompositor(GetAcceleratedWidget()); | 133 CreateCompositor(GetAcceleratedWidget()); |
134 compositor_created_callback_.Run(); | 134 compositor_created_callback_.Run(); |
135 } | 135 } |
136 | 136 |
137 void WindowTreeHostImpl::OnBoundsChanged(RectPtr bounds) { | 137 void WindowTreeHostImpl::OnBoundsChanged(RectPtr bounds) { |
138 bounds_ = bounds.To<gfx::Rect>(); | 138 bounds_ = bounds.To<gfx::Rect>(); |
139 window()->SetBounds(gfx::Rect(bounds_.size())); | |
140 OnHostResized(bounds_.size()); | 139 OnHostResized(bounds_.size()); |
141 } | 140 } |
142 | 141 |
143 void WindowTreeHostImpl::OnDestroyed() { | 142 void WindowTreeHostImpl::OnDestroyed() { |
144 base::MessageLoop::current()->Quit(); | 143 base::MessageLoop::current()->Quit(); |
145 } | 144 } |
146 | 145 |
147 void WindowTreeHostImpl::OnEvent(EventPtr event, | 146 void WindowTreeHostImpl::OnEvent(EventPtr event, |
148 const mojo::Callback<void()>& callback) { | 147 const mojo::Callback<void()>& callback) { |
149 switch (event->action) { | 148 switch (event->action) { |
(...skipping 19 matching lines...) Expand all Loading... |
169 break; | 168 break; |
170 } | 169 } |
171 // TODO(beng): touch, etc. | 170 // TODO(beng): touch, etc. |
172 } | 171 } |
173 callback.Run(); | 172 callback.Run(); |
174 }; | 173 }; |
175 | 174 |
176 } // namespace service | 175 } // namespace service |
177 } // namespace view_manager | 176 } // namespace view_manager |
178 } // namespace mojo | 177 } // namespace mojo |
OLD | NEW |