Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: sky/viewer/document_view.cc

Issue 722713003: Sky: Add a test for the <iframe> element (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: . Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/tests/lowlevel/iframe-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 const mojo::Rect& new_bounds) { 211 const mojo::Rect& new_bounds) {
212 DCHECK_EQ(view, root_); 212 DCHECK_EQ(view, root_);
213 gfx::Size size = new_bounds.To<gfx::Rect>().size(); 213 gfx::Size size = new_bounds.To<gfx::Rect>().size();
214 web_view_->resize(size); 214 web_view_->resize(size);
215 web_layer_tree_view_impl_->setViewportSize(size); 215 web_layer_tree_view_impl_->setViewportSize(size);
216 } 216 }
217 217
218 void DocumentView::OnViewDestroyed(mojo::View* view) { 218 void DocumentView::OnViewDestroyed(mojo::View* view) {
219 DCHECK_EQ(view, root_); 219 DCHECK_EQ(view, root_);
220 220
221 for (auto& child : root_->children())
222 child->Destroy();
223
224 delete this; 221 delete this;
225 } 222 }
226 223
227 void DocumentView::OnViewInputEvent( 224 void DocumentView::OnViewInputEvent(
228 mojo::View* view, const mojo::EventPtr& event) { 225 mojo::View* view, const mojo::EventPtr& event) {
229 scoped_ptr<blink::WebInputEvent> web_event = 226 scoped_ptr<blink::WebInputEvent> web_event =
230 event.To<scoped_ptr<blink::WebInputEvent> >(); 227 event.To<scoped_ptr<blink::WebInputEvent> >();
231 if (web_event) 228 if (web_event)
232 web_view_->handleInputEvent(*web_event); 229 web_view_->handleInputEvent(*web_event);
233 } 230 }
234 231
235 } // namespace sky 232 } // namespace sky
OLDNEW
« no previous file with comments | « sky/tests/lowlevel/iframe-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698