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

Side by Side Diff: chrome/renderer/chrome_render_frame_observer.cc

Issue 1396293003: Use RenderFrameHost::AddMessageToConsole for app banner debug logging. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « chrome/renderer/chrome_render_frame_observer.h ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "chrome/renderer/chrome_render_frame_observer.h" 5 #include "chrome/renderer/chrome_render_frame_observer.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 IPC_MESSAGE_HANDLER(ChromeViewMsg_RequestReloadImageForContextNode, 208 IPC_MESSAGE_HANDLER(ChromeViewMsg_RequestReloadImageForContextNode,
209 OnRequestReloadImageForContextNode) 209 OnRequestReloadImageForContextNode)
210 IPC_MESSAGE_HANDLER(ChromeViewMsg_RequestThumbnailForContextNode, 210 IPC_MESSAGE_HANDLER(ChromeViewMsg_RequestThumbnailForContextNode,
211 OnRequestThumbnailForContextNode) 211 OnRequestThumbnailForContextNode)
212 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetClientSidePhishingDetection, 212 IPC_MESSAGE_HANDLER(ChromeViewMsg_SetClientSidePhishingDetection,
213 OnSetClientSidePhishingDetection) 213 OnSetClientSidePhishingDetection)
214 IPC_MESSAGE_HANDLER(PrintMsg_PrintNodeUnderContextMenu, 214 IPC_MESSAGE_HANDLER(PrintMsg_PrintNodeUnderContextMenu,
215 OnPrintNodeUnderContextMenu) 215 OnPrintNodeUnderContextMenu)
216 IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerPromptRequest, 216 IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerPromptRequest,
217 OnAppBannerPromptRequest) 217 OnAppBannerPromptRequest)
218 IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerDebugMessageRequest,
219 OnAppBannerDebugMessageRequest)
220 IPC_MESSAGE_UNHANDLED(handled = false) 218 IPC_MESSAGE_UNHANDLED(handled = false)
221 IPC_END_MESSAGE_MAP() 219 IPC_END_MESSAGE_MAP()
222 220
223 return handled; 221 return handled;
224 } 222 }
225 223
226 void ChromeRenderFrameObserver::OnSetIsPrerendering(bool is_prerendering) { 224 void ChromeRenderFrameObserver::OnSetIsPrerendering(bool is_prerendering) {
227 if (is_prerendering) { 225 if (is_prerendering) {
228 // If the PrerenderHelper for this frame already exists, don't create it. It 226 // If the PrerenderHelper for this frame already exists, don't create it. It
229 // can already be created for subframes during handling of 227 // can already be created for subframes during handling of
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 // Pass in an empty URL as the destination so that it is always treated 345 // Pass in an empty URL as the destination so that it is always treated
348 // as a cross-origin request. 346 // as a cross-origin request.
349 std::string referrer = blink::WebSecurityPolicy::generateReferrerHeader( 347 std::string referrer = blink::WebSecurityPolicy::generateReferrerHeader(
350 frame->document().referrerPolicy(), GURL(), 348 frame->document().referrerPolicy(), GURL(),
351 frame->document().outgoingReferrer()).utf8(); 349 frame->document().outgoingReferrer()).utf8();
352 350
353 Send(new ChromeViewHostMsg_AppBannerPromptReply( 351 Send(new ChromeViewHostMsg_AppBannerPromptReply(
354 routing_id(), request_id, reply, referrer)); 352 routing_id(), request_id, reply, referrer));
355 } 353 }
356 354
357 void ChromeRenderFrameObserver::OnAppBannerDebugMessageRequest(
358 const std::string& message) {
359 render_frame()->GetWebFrame()->addMessageToConsole(blink::WebConsoleMessage(
360 blink::WebConsoleMessage::LevelDebug, base::UTF8ToUTF16(message)));
361 }
362
363 void ChromeRenderFrameObserver::DidFinishLoad() { 355 void ChromeRenderFrameObserver::DidFinishLoad() {
364 WebLocalFrame* frame = render_frame()->GetWebFrame(); 356 WebLocalFrame* frame = render_frame()->GetWebFrame();
365 // Don't do anything for subframes. 357 // Don't do anything for subframes.
366 if (frame->parent()) 358 if (frame->parent())
367 return; 359 return;
368 360
369 GURL osdd_url = frame->document().openSearchDescriptionURL(); 361 GURL osdd_url = frame->document().openSearchDescriptionURL();
370 if (!osdd_url.is_empty()) { 362 if (!osdd_url.is_empty()) {
371 Send(new ChromeViewHostMsg_PageHasOSDD( 363 Send(new ChromeViewHostMsg_PageHasOSDD(
372 routing_id(), frame->document().url(), osdd_url, 364 routing_id(), frame->document().url(), osdd_url,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 416
425 TRACE_EVENT0("renderer", "ChromeRenderViewObserver::CapturePageInfo"); 417 TRACE_EVENT0("renderer", "ChromeRenderViewObserver::CapturePageInfo");
426 418
427 #if defined(FULL_SAFE_BROWSING) 419 #if defined(FULL_SAFE_BROWSING)
428 // Will swap out the string. 420 // Will swap out the string.
429 if (phishing_classifier_) 421 if (phishing_classifier_)
430 phishing_classifier_->PageCaptured(content, 422 phishing_classifier_->PageCaptured(content,
431 capture_type == PRELIMINARY_CAPTURE); 423 capture_type == PRELIMINARY_CAPTURE);
432 #endif 424 #endif
433 } 425 }
OLDNEW
« no previous file with comments | « chrome/renderer/chrome_render_frame_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698