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::Go(int relative_index) { |
| 71 web_contents()->GetController().GoToOffset(relative_index); |
| 72 } |
| 73 |
70 void BrowserPluginGuest::RendererUnresponsive(WebContents* source) { | 74 void BrowserPluginGuest::RendererUnresponsive(WebContents* source) { |
71 base::ProcessHandle process_handle = | 75 base::ProcessHandle process_handle = |
72 web_contents()->GetRenderProcessHost()->GetHandle(); | 76 web_contents()->GetRenderProcessHost()->GetHandle(); |
73 base::KillProcess(process_handle, RESULT_CODE_HUNG, false); | 77 base::KillProcess(process_handle, RESULT_CODE_HUNG, false); |
74 } | 78 } |
75 | 79 |
76 void BrowserPluginGuest::SetIsAcceptingTouchEvents(bool accept) { | 80 void BrowserPluginGuest::SetIsAcceptingTouchEvents(bool accept) { |
77 SendMessageToEmbedder( | 81 SendMessageToEmbedder( |
78 new BrowserPluginMsg_ShouldAcceptTouchEvents(instance_id(), accept)); | 82 new BrowserPluginMsg_ShouldAcceptTouchEvents(instance_id(), accept)); |
79 } | 83 } |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 iter.Advance(); | 297 iter.Advance(); |
294 } | 298 } |
295 } | 299 } |
296 | 300 |
297 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 301 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
298 DCHECK(embedder_render_process_host()); | 302 DCHECK(embedder_render_process_host()); |
299 embedder_render_process_host()->Send(msg); | 303 embedder_render_process_host()->Send(msg); |
300 } | 304 } |
301 | 305 |
302 } // namespace content | 306 } // namespace content |
OLD | NEW |