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 "sky/viewer/document_view.h" | 5 #include "sky/viewer/document_view.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 } | 202 } |
203 | 203 |
204 blink::ServiceProvider& DocumentView::services() { | 204 blink::ServiceProvider& DocumentView::services() { |
205 return *this; | 205 return *this; |
206 } | 206 } |
207 | 207 |
208 mojo::NavigatorHost* DocumentView::NavigatorHost() { | 208 mojo::NavigatorHost* DocumentView::NavigatorHost() { |
209 return navigator_host_.get(); | 209 return navigator_host_.get(); |
210 } | 210 } |
211 | 211 |
| 212 mojo::Shell* DocumentView::Shell() { |
| 213 return shell_.get(); |
| 214 } |
| 215 |
212 void DocumentView::OnViewBoundsChanged(mojo::View* view, | 216 void DocumentView::OnViewBoundsChanged(mojo::View* view, |
213 const mojo::Rect& old_bounds, | 217 const mojo::Rect& old_bounds, |
214 const mojo::Rect& new_bounds) { | 218 const mojo::Rect& new_bounds) { |
215 DCHECK_EQ(view, root_); | 219 DCHECK_EQ(view, root_); |
216 gfx::Size size = new_bounds.To<gfx::Rect>().size(); | 220 gfx::Size size = new_bounds.To<gfx::Rect>().size(); |
217 web_view_->resize(size); | 221 web_view_->resize(size); |
218 web_layer_tree_view_impl_->setViewportSize(size); | 222 web_layer_tree_view_impl_->setViewportSize(size); |
219 } | 223 } |
220 | 224 |
221 void DocumentView::OnViewFocusChanged(mojo::View* gained_focus, | 225 void DocumentView::OnViewFocusChanged(mojo::View* gained_focus, |
(...skipping 13 matching lines...) Expand all Loading... |
235 | 239 |
236 void DocumentView::OnViewInputEvent( | 240 void DocumentView::OnViewInputEvent( |
237 mojo::View* view, const mojo::EventPtr& event) { | 241 mojo::View* view, const mojo::EventPtr& event) { |
238 scoped_ptr<blink::WebInputEvent> web_event = | 242 scoped_ptr<blink::WebInputEvent> web_event = |
239 event.To<scoped_ptr<blink::WebInputEvent> >(); | 243 event.To<scoped_ptr<blink::WebInputEvent> >(); |
240 if (web_event) | 244 if (web_event) |
241 web_view_->handleInputEvent(*web_event); | 245 web_view_->handleInputEvent(*web_event); |
242 } | 246 } |
243 | 247 |
244 } // namespace sky | 248 } // namespace sky |
OLD | NEW |