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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |