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

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 Comments 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 instance_id(), old_url, new_url, is_top_level)); 412 instance_id(), old_url, new_url, is_top_level));
413 } 413 }
414 414
415 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( 415 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame(
416 int64 frame_id, 416 int64 frame_id,
417 bool is_main_frame, 417 bool is_main_frame,
418 const GURL& url, 418 const GURL& url,
419 PageTransition transition_type, 419 PageTransition transition_type,
420 RenderViewHost* render_view_host) { 420 RenderViewHost* render_view_host) {
421 // Inform its embedder of the updated URL. 421 // Inform its embedder of the updated URL.
422 BrowserPluginMsg_DidNavigate_Params params;
423 params.url = url;
424 params.is_top_level = is_main_frame;
425 params.process_id = render_view_host->GetProcess()->GetID();
426 params.current_entry_index =
427 web_contents()->GetController().GetCurrentEntryIndex();
428 params.entry_count =
429 web_contents()->GetController().GetEntryCount();
430 SendMessageToEmbedder( 422 SendMessageToEmbedder(
431 new BrowserPluginMsg_DidNavigate(instance_id(), params)); 423 new BrowserPluginMsg_LoadCommit(
424 instance_id(),
425 url,
426 render_view_host->GetProcess()->GetID(),
427 is_main_frame));
432 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); 428 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate"));
433 } 429 }
434 430
431 void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) {
432 SendMessageToEmbedder(
433 new BrowserPluginMsg_LoadStop(instance_id()));
434 }
435
435 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { 436 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) {
436 if (pending_input_event_reply_.get()) { 437 if (pending_input_event_reply_.get()) {
437 IPC::Message* reply_message = pending_input_event_reply_.release(); 438 IPC::Message* reply_message = pending_input_event_reply_.release();
438 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, 439 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message,
439 false, 440 false,
440 cursor_); 441 cursor_);
441 SendMessageToEmbedder(reply_message); 442 SendMessageToEmbedder(reply_message);
442 } 443 }
443 SendMessageToEmbedder(new BrowserPluginMsg_GuestCrashed(instance_id())); 444 SendMessageToEmbedder(new BrowserPluginMsg_GuestCrashed(instance_id()));
444 IDMap<RenderViewHost>::const_iterator iter(&pending_updates_); 445 IDMap<RenderViewHost>::const_iterator iter(&pending_updates_);
(...skipping 16 matching lines...) Expand all
461 break; 462 break;
462 } 463 }
463 } 464 }
464 465
465 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { 466 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
466 DCHECK(embedder_render_process_host()); 467 DCHECK(embedder_render_process_host());
467 embedder_render_process_host()->Send(msg); 468 embedder_render_process_host()->Send(msg);
468 } 469 }
469 470
470 } // namespace content 471 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698