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

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

Issue 1005413002: HTMLViewer: Log JS messages to console (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | 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 "mojo/services/html_viewer/html_document.h" 5 #include "mojo/services/html_viewer/html_document.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/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 270
271 return blink::WebNavigationPolicyIgnore; 271 return blink::WebNavigationPolicyIgnore;
272 } 272 }
273 273
274 void HTMLDocument::didAddMessageToConsole( 274 void HTMLDocument::didAddMessageToConsole(
275 const blink::WebConsoleMessage& message, 275 const blink::WebConsoleMessage& message,
276 const blink::WebString& source_name, 276 const blink::WebString& source_name,
277 unsigned source_line, 277 unsigned source_line,
278 const blink::WebString& stack_trace) { 278 const blink::WebString& stack_trace) {
279 VLOG(1) << "[" << source_name.utf8() << "(" << source_line << ")] "
280 << message.text.utf8();
279 } 281 }
280 282
281 void HTMLDocument::didNavigateWithinPage( 283 void HTMLDocument::didNavigateWithinPage(
282 blink::WebLocalFrame* frame, 284 blink::WebLocalFrame* frame,
283 const blink::WebHistoryItem& history_item, 285 const blink::WebHistoryItem& history_item,
284 blink::WebHistoryCommitType commit_type) { 286 blink::WebHistoryCommitType commit_type) {
285 if (navigator_host_.get()) 287 if (navigator_host_.get())
286 navigator_host_->DidNavigateLocally(history_item.urlString().utf8()); 288 navigator_host_->DidNavigateLocally(history_item.urlString().utf8());
287 } 289 }
288 290
(...skipping 22 matching lines...) Expand all
311 } 313 }
312 314
313 void HTMLDocument::OnViewInputEvent(View* view, const mojo::EventPtr& event) { 315 void HTMLDocument::OnViewInputEvent(View* view, const mojo::EventPtr& event) {
314 scoped_ptr<blink::WebInputEvent> web_event = 316 scoped_ptr<blink::WebInputEvent> web_event =
315 event.To<scoped_ptr<blink::WebInputEvent>>(); 317 event.To<scoped_ptr<blink::WebInputEvent>>();
316 if (web_event) 318 if (web_event)
317 web_view_->handleInputEvent(*web_event); 319 web_view_->handleInputEvent(*web_event);
318 } 320 }
319 321
320 } // namespace html_viewer 322 } // namespace html_viewer
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698