OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |