Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 10917225: Browser Plugin: Reload and Stop operations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed nit Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 static_cast<RenderViewHostImpl*>(render_view_host); 218 static_cast<RenderViewHostImpl*>(render_view_host);
219 guest_rvh->StopHangMonitorTimeout(); 219 guest_rvh->StopHangMonitorTimeout();
220 DCHECK(pending_input_event_reply_.get()); 220 DCHECK(pending_input_event_reply_.get());
221 IPC::Message* reply_message = pending_input_event_reply_.release(); 221 IPC::Message* reply_message = pending_input_event_reply_.release();
222 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message, 222 BrowserPluginHostMsg_HandleInputEvent::WriteReplyParams(reply_message,
223 handled, 223 handled,
224 cursor_); 224 cursor_);
225 SendMessageToEmbedder(reply_message); 225 SendMessageToEmbedder(reply_message);
226 } 226 }
227 227
228 void BrowserPluginGuest::Stop() {
229 web_contents()->Stop();
230 }
231
232 void BrowserPluginGuest::Reload() {
233 // TODO(fsamuel): Don't check for repost because we don't want to show
234 // Chromium's repost warning. We might want to implement a separate API
235 // for registering a callback if a repost is about to happen.
236 web_contents()->GetController().Reload(false);
237 }
238
228 void BrowserPluginGuest::SetFocus(bool focused) { 239 void BrowserPluginGuest::SetFocus(bool focused) {
229 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost(); 240 RenderViewHost* render_view_host = web_contents()->GetRenderViewHost();
230 render_view_host->Send( 241 render_view_host->Send(
231 new ViewMsg_SetFocus(render_view_host->GetRoutingID(), focused)); 242 new ViewMsg_SetFocus(render_view_host->GetRoutingID(), focused));
232 } 243 }
233 244
234 void BrowserPluginGuest::ShowWidget(RenderViewHost* render_view_host, 245 void BrowserPluginGuest::ShowWidget(RenderViewHost* render_view_host,
235 int route_id, 246 int route_id,
236 const gfx::Rect& initial_pos) { 247 const gfx::Rect& initial_pos) {
237 gfx::Rect screen_pos(initial_pos); 248 gfx::Rect screen_pos(initial_pos);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 pending_updates_.Remove(iter.GetCurrentKey()); 282 pending_updates_.Remove(iter.GetCurrentKey());
272 iter.Advance(); 283 iter.Advance();
273 } 284 }
274 } 285 }
275 286
276 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { 287 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
277 embedder_render_process_host()->Send(msg); 288 embedder_render_process_host()->Send(msg);
278 } 289 }
279 290
280 } // namespace content 291 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698