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 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
367 instance_id(), old_url, new_url, is_top_level)); | 367 instance_id(), old_url, new_url, is_top_level)); |
368 } | 368 } |
369 | 369 |
370 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( | 370 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( |
371 int64 frame_id, | 371 int64 frame_id, |
372 bool is_main_frame, | 372 bool is_main_frame, |
373 const GURL& url, | 373 const GURL& url, |
374 PageTransition transition_type, | 374 PageTransition transition_type, |
375 RenderViewHost* render_view_host) { | 375 RenderViewHost* render_view_host) { |
376 // Inform its embedder of the updated URL. | 376 // Inform its embedder of the updated URL. |
377 if (is_main_frame) { | 377 SendMessageToEmbedder( |
378 new BrowserPluginMsg_LoadCommit( | |
379 instance_id(), | |
380 url, | |
381 render_view_host->GetProcess()->GetID(), | |
382 is_main_frame)); | |
383 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidCommit")); | |
Charlie Reis
2012/10/08 19:03:39
Let's stick with DidNavigate here, since we alread
irobert
2012/10/10 23:55:16
Done.
| |
384 } | |
385 | |
386 void BrowserPluginGuest::DidFinishLoad(int64 frame_id, | |
Charlie Reis
2012/10/08 19:03:39
We should be listening to DidStopLoading rather th
irobert
2012/10/10 23:55:16
Done.
| |
387 const GURL& validated_url, | |
388 bool is_main_frame, | |
389 RenderViewHost* render_view_host) { | |
390 if(is_main_frame) | |
378 SendMessageToEmbedder( | 391 SendMessageToEmbedder( |
379 new BrowserPluginMsg_DidNavigate( | 392 new BrowserPluginMsg_LoadStop(instance_id())); |
380 instance_id(), | |
381 url, | |
382 render_view_host->GetProcess()->GetID())); | |
383 RecordAction(UserMetricsAction("BrowserPlugin.Guest.DidNavigate")); | |
384 } | |
385 } | 393 } |
386 | 394 |
387 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { | 395 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { |
388 if (pending_input_event_reply_.get()) { | 396 if (pending_input_event_reply_.get()) { |
389 IPC::Message* reply_message = pending_input_event_reply_.release(); | 397 IPC::Message* reply_message = pending_input_event_reply_.release(); |
390 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, | 398 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, |
391 false, | 399 false, |
392 cursor_); | 400 cursor_); |
393 SendMessageToEmbedder(reply_message); | 401 SendMessageToEmbedder(reply_message); |
394 } | 402 } |
(...skipping 18 matching lines...) Expand all Loading... | |
413 break; | 421 break; |
414 } | 422 } |
415 } | 423 } |
416 | 424 |
417 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 425 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
418 DCHECK(embedder_render_process_host()); | 426 DCHECK(embedder_render_process_host()); |
419 embedder_render_process_host()->Send(msg); | 427 embedder_render_process_host()->Send(msg); |
420 } | 428 } |
421 | 429 |
422 } // namespace content | 430 } // namespace content |
OLD | NEW |