Chromium Code Reviews| 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 "content/browser/browser_plugin/browser_plugin_guest_helper.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h" |
| 10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" | 10 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 cursor_ = cursor; | 244 cursor_ = cursor; |
| 245 } | 245 } |
| 246 | 246 |
| 247 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( | 247 void BrowserPluginGuest::DidCommitProvisionalLoadForFrame( |
| 248 int64 frame_id, | 248 int64 frame_id, |
| 249 bool is_main_frame, | 249 bool is_main_frame, |
| 250 const GURL& url, | 250 const GURL& url, |
| 251 PageTransition transition_type, | 251 PageTransition transition_type, |
| 252 RenderViewHost* render_view_host) { | 252 RenderViewHost* render_view_host) { |
| 253 // Inform its embedder of the updated URL. | 253 // Inform its embedder of the updated URL. |
| 254 DCHECK(embedder_render_process_host()); | 254 DCHECK(embedder_render_process_host()); |
|
lazyboy
2012/09/20 19:47:04
Sorry, this is from before though: this check shou
Fady Samuel
2012/09/20 21:58:05
Done.
| |
| 255 if (is_main_frame) | 255 if (is_main_frame) |
| 256 SendMessageToEmbedder(new BrowserPluginMsg_DidNavigate(instance_id(), url)); | 256 SendMessageToEmbedder( |
| 257 new BrowserPluginMsg_DidNavigate( | |
| 258 instance_id(), | |
| 259 url, | |
| 260 render_view_host->GetProcess()->GetID())); | |
| 257 } | 261 } |
| 258 | 262 |
| 259 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { | 263 void BrowserPluginGuest::RenderViewGone(base::TerminationStatus status) { |
| 260 DCHECK(embedder_render_process_host()); | 264 DCHECK(embedder_render_process_host()); |
| 261 if (pending_input_event_reply_.get()) { | 265 if (pending_input_event_reply_.get()) { |
| 262 IPC::Message* reply_message = pending_input_event_reply_.release(); | 266 IPC::Message* reply_message = pending_input_event_reply_.release(); |
| 263 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, | 267 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, |
| 264 false, | 268 false, |
| 265 cursor_); | 269 cursor_); |
| 266 SendMessageToEmbedder(reply_message); | 270 SendMessageToEmbedder(reply_message); |
| 267 } | 271 } |
| 268 SendMessageToEmbedder(new BrowserPluginMsg_GuestCrashed(instance_id())); | 272 SendMessageToEmbedder(new BrowserPluginMsg_GuestCrashed(instance_id())); |
| 269 IDMap<RenderViewHost>::const_iterator iter(&pending_updates_); | 273 IDMap<RenderViewHost>::const_iterator iter(&pending_updates_); |
| 270 while (!iter.IsAtEnd()) { | 274 while (!iter.IsAtEnd()) { |
| 271 pending_updates_.Remove(iter.GetCurrentKey()); | 275 pending_updates_.Remove(iter.GetCurrentKey()); |
| 272 iter.Advance(); | 276 iter.Advance(); |
| 273 } | 277 } |
| 274 } | 278 } |
| 275 | 279 |
| 276 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 280 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
| 277 embedder_render_process_host()->Send(msg); | 281 embedder_render_process_host()->Send(msg); |
| 278 } | 282 } |
| 279 | 283 |
| 280 } // namespace content | 284 } // namespace content |
| OLD | NEW |