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

Side by Side Diff: mojo/services/html_viewer/html_document_view.cc

Issue 507173003: Change TypeConverter<X,Y>::ConvertFrom and ConvertTo into a single symmetric (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compile for real Created 6 years, 3 months 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
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 "mojo/services/html_viewer/html_document_view.h" 5 #include "mojo/services/html_viewer/html_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/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 208
209 void HTMLDocumentView::OnViewDestroyed(View* view) { 209 void HTMLDocumentView::OnViewDestroyed(View* view) {
210 DCHECK_EQ(view, root_); 210 DCHECK_EQ(view, root_);
211 view->RemoveObserver(this); 211 view->RemoveObserver(this);
212 root_ = NULL; 212 root_ = NULL;
213 } 213 }
214 214
215 void HTMLDocumentView::OnViewInputEvent(View* view, const EventPtr& event) { 215 void HTMLDocumentView::OnViewInputEvent(View* view, const EventPtr& event) {
216 scoped_ptr<blink::WebInputEvent> web_event = 216 scoped_ptr<blink::WebInputEvent> web_event =
217 TypeConverter<EventPtr, scoped_ptr<blink::WebInputEvent> >::ConvertTo( 217 event.To<scoped_ptr<blink::WebInputEvent> >();
218 event);
219 if (web_event) 218 if (web_event)
220 web_view_->handleInputEvent(*web_event); 219 web_view_->handleInputEvent(*web_event);
221 } 220 }
222 221
223 void HTMLDocumentView::Repaint() { 222 void HTMLDocumentView::Repaint() {
224 repaint_pending_ = false; 223 repaint_pending_ = false;
225 224
226 web_view_->animate(0.0); 225 web_view_->animate(0.0);
227 web_view_->layout(); 226 web_view_->layout();
228 227
229 int width = web_view_->size().width; 228 int width = web_view_->size().width;
230 int height = web_view_->size().height; 229 int height = web_view_->size().height;
231 230
232 skia::RefPtr<SkCanvas> canvas = skia::AdoptRef(SkCanvas::NewRaster( 231 skia::RefPtr<SkCanvas> canvas = skia::AdoptRef(SkCanvas::NewRaster(
233 SkImageInfo::MakeN32(width, height, kOpaque_SkAlphaType))); 232 SkImageInfo::MakeN32(width, height, kOpaque_SkAlphaType)));
234 233
235 web_view_->paint(canvas.get(), gfx::Rect(0, 0, width, height)); 234 web_view_->paint(canvas.get(), gfx::Rect(0, 0, width, height));
236 235
237 root_->SetContents(canvas->getDevice()->accessBitmap(false)); 236 root_->SetContents(canvas->getDevice()->accessBitmap(false));
238 } 237 }
239 238
240 } // namespace mojo 239 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/services/html_viewer/blink_url_request_type_converters.cc ('k') | mojo/services/native_viewport/native_viewport_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698