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

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

Issue 10960003: Browser Plugin: Implement Back, Forward, and Go. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a test 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } 60 }
61 return new BrowserPluginGuest(instance_id, web_contents, render_view_host); 61 return new BrowserPluginGuest(instance_id, web_contents, render_view_host);
62 } 62 }
63 63
64 bool BrowserPluginGuest::ViewTakeFocus(bool reverse) { 64 bool BrowserPluginGuest::ViewTakeFocus(bool reverse) {
65 SendMessageToEmbedder( 65 SendMessageToEmbedder(
66 new BrowserPluginMsg_AdvanceFocus(instance_id(), reverse)); 66 new BrowserPluginMsg_AdvanceFocus(instance_id(), reverse));
67 return true; 67 return true;
68 } 68 }
69 69
70 void BrowserPluginGuest::Back() {
71 web_contents()->GetController().GoBack();
72 }
73
74 void BrowserPluginGuest::Forward() {
75 web_contents()->GetController().GoForward();
76 }
77
78 void BrowserPluginGuest::Go(int relative_index) {
79 web_contents()->GetController().GoToOffset(relative_index);
80 }
81
70 void BrowserPluginGuest::RendererUnresponsive(WebContents* source) { 82 void BrowserPluginGuest::RendererUnresponsive(WebContents* source) {
71 base::ProcessHandle process_handle = 83 base::ProcessHandle process_handle =
72 web_contents()->GetRenderProcessHost()->GetHandle(); 84 web_contents()->GetRenderProcessHost()->GetHandle();
73 base::KillProcess(process_handle, RESULT_CODE_HUNG, false); 85 base::KillProcess(process_handle, RESULT_CODE_HUNG, false);
74 } 86 }
75 87
76 void BrowserPluginGuest::SetDamageBuffer( 88 void BrowserPluginGuest::SetDamageBuffer(
77 TransportDIB* damage_buffer, 89 TransportDIB* damage_buffer,
78 #if defined(OS_WIN) 90 #if defined(OS_WIN)
79 int damage_buffer_size, 91 int damage_buffer_size,
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 pending_updates_.Remove(iter.GetCurrentKey()); 283 pending_updates_.Remove(iter.GetCurrentKey());
272 iter.Advance(); 284 iter.Advance();
273 } 285 }
274 } 286 }
275 287
276 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { 288 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) {
277 embedder_render_process_host()->Send(msg); 289 embedder_render_process_host()->Send(msg);
278 } 290 }
279 291
280 } // namespace content 292 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698