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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 BrowserPluginMsg_DidNavigate_Params params; |
387 SendMessageToEmbedder( | 387 params.url = url; |
388 new BrowserPluginMsg_DidNavigate( | 388 params.is_top_level = is_main_frame; |
389 instance_id(), | 389 params.process_id = render_view_host->GetProcess()->GetID(); |
390 url, | 390 params.current_entry_index = |
391 render_view_host->GetProcess()->GetID())); | 391 web_contents()->GetController().GetCurrentEntryIndex(); |
392 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); | 392 params.entry_count = |
393 } | 393 web_contents()->GetController().GetEntryCount(); |
| 394 SendMessageToEmbedder( |
| 395 new BrowserPluginMsg_DidNavigate(instance_id(), params)); |
| 396 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); |
394 } | 397 } |
395 | 398 |
396 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { | 399 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { |
397 if (pending_input_event_reply_.get()) { | 400 if (pending_input_event_reply_.get()) { |
398 IPC::Message* reply_message = pending_input_event_reply_.release(); | 401 IPC::Message* reply_message = pending_input_event_reply_.release(); |
399 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, | 402 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, |
400 false, | 403 false, |
401 cursor_); | 404 cursor_); |
402 SendMessageToEmbedder(reply_message); | 405 SendMessageToEmbedder(reply_message); |
403 } | 406 } |
(...skipping 18 matching lines...) Expand all Loading... |
422 break; | 425 break; |
423 } | 426 } |
424 } | 427 } |
425 | 428 |
426 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 429 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
427 DCHECK(embedder_render_process_host()); | 430 DCHECK(embedder_render_process_host()); |
428 embedder_render_process_host()->Send(msg); | 431 embedder_render_process_host()->Send(msg); |
429 } | 432 } |
430 | 433 |
431 } // namespace content | 434 } // namespace content |
OLD | NEW |