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/renderer/browser_plugin/old/browser_plugin_channel_manager.h" | 5 #include "content/renderer/browser_plugin/old/browser_plugin_channel_manager.h" |
6 | 6 |
7 #include "base/process_util.h" | 7 #include "base/process_util.h" |
8 #include "content/common/browser_plugin_messages.h" | 8 #include "content/common/browser_plugin_messages.h" |
9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "content/renderer/browser_plugin/old/browser_plugin.h" | 10 #include "content/renderer/browser_plugin/old/browser_plugin.h" |
11 #include "content/renderer/browser_plugin/old/guest_to_embedder_channel.h" | 11 #include "content/renderer/browser_plugin/old/guest_to_embedder_channel.h" |
12 #include "content/renderer/render_thread_impl.h" | 12 #include "content/renderer/render_thread_impl.h" |
13 #include "content/renderer/render_view_impl.h" | 13 #include "content/renderer/render_view_impl.h" |
14 #include "ppapi/c/pp_instance.h" | 14 #include "ppapi/c/pp_instance.h" |
| 15 #include "webkit/glue/webpreferences.h" |
| 16 |
| 17 using webkit_glue::WebPreferences; |
15 | 18 |
16 namespace content { | 19 namespace content { |
17 | 20 |
18 BrowserPluginChannelManager::BrowserPluginChannelManager() { | 21 BrowserPluginChannelManager::BrowserPluginChannelManager() { |
19 } | 22 } |
20 | 23 |
21 BrowserPluginChannelManager::~BrowserPluginChannelManager() { | 24 BrowserPluginChannelManager::~BrowserPluginChannelManager() { |
22 } | 25 } |
23 | 26 |
24 void BrowserPluginChannelManager::CreateRenderView( | 27 void BrowserPluginChannelManager::CreateRenderView( |
(...skipping 14 matching lines...) Expand all Loading... |
39 // This ensures this process will be notified when it is closed even if a | 42 // This ensures this process will be notified when it is closed even if a |
40 // connection is not established. | 43 // connection is not established. |
41 embedder_channel_handle.socket = | 44 embedder_channel_handle.socket = |
42 base::FileDescriptor(channel->TakeRendererFD(), true); | 45 base::FileDescriptor(channel->TakeRendererFD(), true); |
43 if (embedder_channel_handle.socket.fd == -1) | 46 if (embedder_channel_handle.socket.fd == -1) |
44 success = false; | 47 success = false; |
45 #endif | 48 #endif |
46 DCHECK(success); | 49 DCHECK(success); |
47 embedder_channels_[params.embedder_channel_name] = channel; | 50 embedder_channels_[params.embedder_channel_name] = channel; |
48 } | 51 } |
| 52 |
| 53 // Force compositing on browser tag guests since software rendering path is |
| 54 // not implemented (yet). Short term solution so force compositing is not |
| 55 // required to be set globally. |
| 56 WebPreferences modified_web_preferences = params.web_preferences; |
| 57 modified_web_preferences.force_compositing_mode = true; |
| 58 |
49 RenderViewImpl* render_view = | 59 RenderViewImpl* render_view = |
50 RenderViewImpl::Create( | 60 RenderViewImpl::Create( |
51 params.parent_window, | 61 params.parent_window, |
52 params.opener_route_id, | 62 params.opener_route_id, |
53 params.renderer_preferences, | 63 params.renderer_preferences, |
54 params.web_preferences, | 64 modified_web_preferences, |
55 new SharedRenderViewCounter(0), | 65 new SharedRenderViewCounter(0), |
56 params.view_id, | 66 params.view_id, |
57 params.surface_id, | 67 params.surface_id, |
58 params.session_storage_namespace_id, | 68 params.session_storage_namespace_id, |
59 params.frame_name, | 69 params.frame_name, |
60 false, | 70 false, |
61 params.swapped_out, | 71 params.swapped_out, |
62 params.next_page_id, | 72 params.next_page_id, |
63 params.screen_info, | 73 params.screen_info, |
64 channel, | 74 channel, |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 browser_plugin->LoadGuest(guest_process_id, channel_handle); | 145 browser_plugin->LoadGuest(guest_process_id, channel_handle); |
136 } | 146 } |
137 | 147 |
138 void BrowserPluginChannelManager::OnAdvanceFocus(int instance_id, | 148 void BrowserPluginChannelManager::OnAdvanceFocus(int instance_id, |
139 bool reverse) { | 149 bool reverse) { |
140 BrowserPlugin* browser_plugin = BrowserPlugin::FromID(instance_id); | 150 BrowserPlugin* browser_plugin = BrowserPlugin::FromID(instance_id); |
141 browser_plugin->AdvanceFocus(reverse); | 151 browser_plugin->AdvanceFocus(reverse); |
142 } | 152 } |
143 | 153 |
144 } // namespace content | 154 } // namespace content |
OLD | NEW |