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 "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h" | 10 #include "content/browser/browser_plugin/browser_plugin_guest_helper.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 bool BrowserPluginGuest::CanDownload(RenderViewHost* render_view_host, | 79 bool BrowserPluginGuest::CanDownload(RenderViewHost* render_view_host, |
80 int request_id, | 80 int request_id, |
81 const std::string& request_method) { | 81 const std::string& request_method) { |
82 // TODO(fsamuel): We disable downloads in guests for now, but we will later | 82 // TODO(fsamuel): We disable downloads in guests for now, but we will later |
83 // expose API to allow embedders to handle them. | 83 // expose API to allow embedders to handle them. |
84 // Note: it seems content_shell ignores this. This should be fixed | 84 // Note: it seems content_shell ignores this. This should be fixed |
85 // for debugging and test purposes. | 85 // for debugging and test purposes. |
86 return false; | 86 return false; |
87 } | 87 } |
88 | 88 |
| 89 bool BrowserPluginGuest::HandleContextMenu( |
| 90 const ContextMenuParams& params) { |
| 91 // TODO(fsamuel): We have a do nothing context menu handler for now until |
| 92 // we implement the Apps Context Menu API for Browser Plugin (see |
| 93 // http://crbug.com/140315). |
| 94 return true; |
| 95 } |
| 96 |
89 void BrowserPluginGuest::RendererUnresponsive(WebContents* source) { | 97 void BrowserPluginGuest::RendererUnresponsive(WebContents* source) { |
90 base::ProcessHandle process_handle = | 98 base::ProcessHandle process_handle = |
91 web_contents()->GetRenderProcessHost()->GetHandle(); | 99 web_contents()->GetRenderProcessHost()->GetHandle(); |
92 base::KillProcess(process_handle, RESULT_CODE_HUNG, false); | 100 base::KillProcess(process_handle, RESULT_CODE_HUNG, false); |
93 RecordAction(UserMetricsAction("BrowserPlugin.Guest.Hung")); | 101 RecordAction(UserMetricsAction("BrowserPlugin.Guest.Hung")); |
94 } | 102 } |
95 | 103 |
96 void BrowserPluginGuest::SetIsAcceptingTouchEvents(bool accept) { | 104 void BrowserPluginGuest::SetIsAcceptingTouchEvents(bool accept) { |
97 SendMessageToEmbedder( | 105 SendMessageToEmbedder( |
98 new BrowserPluginMsg_ShouldAcceptTouchEvents(instance_id(), accept)); | 106 new BrowserPluginMsg_ShouldAcceptTouchEvents(instance_id(), accept)); |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 break; | 375 break; |
368 } | 376 } |
369 } | 377 } |
370 | 378 |
371 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { | 379 void BrowserPluginGuest::SendMessageToEmbedder(IPC::Message* msg) { |
372 DCHECK(embedder_render_process_host()); | 380 DCHECK(embedder_render_process_host()); |
373 embedder_render_process_host()->Send(msg); | 381 embedder_render_process_host()->Send(msg); |
374 } | 382 } |
375 | 383 |
376 } // namespace content | 384 } // namespace content |
OLD | NEW |