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 SendMessageToEmbedder( |
387 SendMessageToEmbedder( | 387 new BrowserPluginMsg_LoadCommit( |
388 new BrowserPluginMsg_DidNavigate( | 388 instance_id(), |
389 instance_id(), | 389 url, |
390 url, | 390 render_view_host->GetProcess()->GetID(), |
391 render_view_host->GetProcess()->GetID())); | 391 is_main_frame)); |
392 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); | 392 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); |
393 } | 393 } |
394 | |
395 void BrowserPluginGuest::DidStopLoading(RenderViewHost* render_view_host) { | |
396 // Inform its embedder of loadStop. | |
Charlie Reis
2012/10/11 18:55:28
nit: This is clear from the code, so we don't need
irobert
2012/10/11 20:45:49
Done.
| |
397 SendMessageToEmbedder( | |
398 new BrowserPluginMsg_LoadStop(instance_id())); | |
394 } | 399 } |
395 | 400 |
396 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { | 401 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { |
397 if (pending_input_event_reply_.get()) { | 402 if (pending_input_event_reply_.get()) { |
398 IPC::Message* reply_message = pending_input_event_reply_.release(); | 403 IPC::Message* reply_message = pending_input_event_reply_.release(); |
399 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, | 404 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, |
400 false, | 405 false, |
401 cursor_); | 406 cursor_); |
402 SendMessageToEmbedder(reply_message); | 407 SendMessageToEmbedder(reply_message); |
403 } | 408 } |
(...skipping 18 matching lines...) Expand all Loading... | |
422 break; | 427 break; |
423 } | 428 } |
424 } | 429 } |
425 | 430 |
426 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 431 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
427 DCHECK(embedder_render_process_host()); | 432 DCHECK(embedder_render_process_host()); |
428 embedder_render_process_host()->Send(msg); | 433 embedder_render_process_host()->Send(msg); |
429 } | 434 } |
430 | 435 |
431 } // namespace content | 436 } // namespace content |
OLD | NEW |