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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 11035067: Add loadCommit and loadStop Event (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Test and Nits Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h" 10 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 instance_id(), old_url, new_url, is_top_level)); 376 instance_id(), old_url, new_url, is_top_level));
377 } 377 }
378 378
379 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( 379 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame(
380 int64 frame_id, 380 int64 frame_id,
381 bool is_main_frame, 381 bool is_main_frame,
382 const GURL& url, 382 const GURL& url,
383 PageTransition transition_type, 383 PageTransition transition_type,
384 RenderViewHost* render_view_host) { 384 RenderViewHost* render_view_host) {
385 // Inform its embedder of the updated URL. 385 // Inform its embedder of the updated URL.
386 if (is_main_frame) { 386 SendMessageToEmbedder(
387 SendMessageToEmbedder( 387 new BrowserPluginMsg_LoadCommit(
388 new BrowserPluginMsg_DidNavigate( 388 instance_id(),
389 instance_id(), 389 url,
390 url, 390 render_view_host->GetProcess()->GetID(),
391 render_view_host->GetProcess()->GetID())); 391 is_main_frame));
392 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); 392 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate"));
393 } 393 }
394
395 void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) {
396 SendMessageToEmbedder(
397 new BrowserPluginMsg_LoadStop(instance_id()));
394 } 398 }
395 399
396 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { 400 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) {
397 if (pending_input_event_reply_.get()) { 401 if (pending_input_event_reply_.get()) {
398 IPC::Message* reply_message = pending_input_event_reply_.release(); 402 IPC::Message* reply_message = pending_input_event_reply_.release();
399 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, 403 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message,
400 false, 404 false,
401 cursor_); 405 cursor_);
402 SendMessageToEmbedder(reply_message); 406 SendMessageToEmbedder(reply_message);
403 } 407 }
(...skipping 18 matching lines...) Expand all
422 break; 426 break;
423 } 427 }
424 } 428 }
425 429
426 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { 430 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
427 DCHECK(embedder_render_process_host()); 431 DCHECK(embedder_render_process_host());
428 embedder_render_process_host()->Send(msg); 432 embedder_render_process_host()->Send(msg);
429 } 433 }
430 434
431 } // namespace content 435 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698