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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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; | 422 BrowserPluginMsg_LoadCommit_Params params; |
423 params.url = url; | 423 params.url = url; |
424 params.is_top_level = is_main_frame; | 424 params.is_top_level = is_main_frame; |
425 params.process_id = render_view_host->GetProcess()->GetID(); | 425 params.process_id = render_view_host->GetProcess()->GetID(); |
426 params.current_entry_index = | 426 params.current_entry_index = |
427 web_contents()->GetController().GetCurrentEntryIndex(); | 427 web_contents()->GetController().GetCurrentEntryIndex(); |
428 params.entry_count = | 428 params.entry_count = |
429 web_contents()->GetController().GetEntryCount(); | 429 web_contents()->GetController().GetEntryCount(); |
430 SendMessageToEmbedder( | 430 SendMessageToEmbedder( |
431 new BrowserPluginMsg_DidNavigate(instance_id(), params)); | 431 new BrowserPluginMsg_LoadCommit(instance_id(), params)); |
432 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); | 432 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidCommit")); |
Charlie Reis
2012/10/16 21:17:55
As before, please leave this as BrowserPlugin.Gues
irobert
2012/10/17 20:12:37
Done.
| |
433 } | |
434 | |
435 void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) { | |
436 SendMessageToEmbedder( | |
437 new BrowserPluginMsg_LoadStop(instance_id())); | |
Charlie Reis
2012/10/16 21:17:55
This will all fit on one line.
irobert
2012/10/17 20:12:37
Done.
| |
433 } | 438 } |
434 | 439 |
435 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { | 440 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { |
436 if (pending_input_event_reply_.get()) { | 441 if (pending_input_event_reply_.get()) { |
437 IPC::Message* reply_message = pending_input_event_reply_.release(); | 442 IPC::Message* reply_message = pending_input_event_reply_.release(); |
438 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, | 443 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, |
439 false, | 444 false, |
440 cursor_); | 445 cursor_); |
441 SendMessageToEmbedder(reply_message); | 446 SendMessageToEmbedder(reply_message); |
442 } | 447 } |
(...skipping 18 matching lines...) Expand all Loading... | |
461 break; | 466 break; |
462 } | 467 } |
463 } | 468 } |
464 | 469 |
465 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 470 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
466 DCHECK(embedder_render_process_host()); | 471 DCHECK(embedder_render_process_host()); |
467 embedder_render_process_host()->Send(msg); | 472 embedder_render_process_host()->Send(msg); |
468 } | 473 } |
469 | 474 |
470 } // namespace content | 475 } // namespace content |
OLD | NEW |