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

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 ShimSrcAttribute Test 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 instance_id(), old_url, new_url, is_top_level)); 419 instance_id(), old_url, new_url, is_top_level));
420 } 420 }
421 421
422 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( 422 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame(
423 int64 frame_id, 423 int64 frame_id,
424 bool is_main_frame, 424 bool is_main_frame,
425 const GURL& url, 425 const GURL& url,
426 PageTransition transition_type, 426 PageTransition transition_type,
427 RenderViewHost* render_view_host) { 427 RenderViewHost* render_view_host) {
428 // Inform its embedder of the updated URL. 428 // Inform its embedder of the updated URL.
429 BrowserPluginMsg_DidNavigate_Params params; 429 BrowserPluginMsg_LoadCommit_Params params;
430 params.url = url; 430 params.url = url;
431 params.is_top_level = is_main_frame; 431 params.is_top_level = is_main_frame;
432 params.process_id = render_view_host->GetProcess()->GetID(); 432 params.process_id = render_view_host->GetProcess()->GetID();
433 params.current_entry_index = 433 params.current_entry_index =
434 web_contents()->GetController().GetCurrentEntryIndex(); 434 web_contents()->GetController().GetCurrentEntryIndex();
435 params.entry_count = 435 params.entry_count =
436 web_contents()->GetController().GetEntryCount(); 436 web_contents()->GetController().GetEntryCount();
437 SendMessageToEmbedder( 437 SendMessageToEmbedder(
438 new BrowserPluginMsg_DidNavigate(instance_id(), params)); 438 new BrowserPluginMsg_LoadCommit(instance_id(), params));
439 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); 439 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate"));
440 } 440 }
441 441
442 void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) {
443 SendMessageToEmbedder(new BrowserPluginMsg_LoadStop(instance_id()));
444 }
445
442 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { 446 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) {
443 if (pending_input_event_reply_.get()) { 447 if (pending_input_event_reply_.get()) {
444 IPC::Message* reply_message = pending_input_event_reply_.release(); 448 IPC::Message* reply_message = pending_input_event_reply_.release();
445 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, 449 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message,
446 false, 450 false,
447 cursor_); 451 cursor_);
448 SendMessageToEmbedder(reply_message); 452 SendMessageToEmbedder(reply_message);
449 } 453 }
450 SendMessageToEmbedder(new BrowserPluginMsg_GuestCrashed(instance_id())); 454 SendMessageToEmbedder(new BrowserPluginMsg_GuestCrashed(instance_id()));
451 IDMap<RenderViewHost>::const_iterator iter(&pending_updates_); 455 IDMap<RenderViewHost>::const_iterator iter(&pending_updates_);
(...skipping 15 matching lines...) Expand all
467 default: 471 default:
468 break; 472 break;
469 } 473 }
470 } 474 }
471 475
472 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { 476 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
473 embedder_web_contents_->GetRenderProcessHost()->Send(msg); 477 embedder_web_contents_->GetRenderProcessHost()->Send(msg);
474 } 478 }
475 479
476 } // namespace content 480 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698