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_embedder.h" | 5 #include "content/browser/browser_plugin/browser_plugin_embedder.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 render_view_host->GetSiteInstance()->GetSite().host(); | 90 render_view_host->GetSiteInstance()->GetSite().host(); |
91 guest_web_contents = WebContentsImpl::CreateGuest( | 91 guest_web_contents = WebContentsImpl::CreateGuest( |
92 web_contents()->GetBrowserContext(), | 92 web_contents()->GetBrowserContext(), |
93 host, | 93 host, |
94 instance_id); | 94 instance_id); |
95 | 95 |
96 guest = guest_web_contents->GetBrowserPluginGuest(); | 96 guest = guest_web_contents->GetBrowserPluginGuest(); |
97 guest->set_embedder_render_process_host( | 97 guest->set_embedder_render_process_host( |
98 render_view_host->GetProcess()); | 98 render_view_host->GetProcess()); |
99 | 99 |
100 guest_web_contents->GetMutableRendererPrefs()-> | 100 RendererPreferences* guest_renderer_prefs = |
101 throttle_input_events = false; | 101 guest_web_contents->GetMutableRendererPrefs(); |
102 // Copy renderer preferences to guest. For GTK and Aura this is necessary to | |
Charlie Reis
2012/09/27 19:01:32
I'd like to make a note here that this is intentio
lazyboy
2012/09/27 23:02:23
Done.
| |
103 // get proper renderer configuration values for caret blinking interval, | |
104 // colors related to selection and focus. | |
105 *guest_renderer_prefs = *web_contents()->GetMutableRendererPrefs(); | |
Charlie Reis
2012/09/25 19:15:25
Just curious why this is necessary. Where does th
lazyboy
2012/09/25 19:26:20
I believe RenderViewHostImpl.CreateRenderView() ge
Charlie Reis
2012/09/25 21:04:36
That's probably where the prefs are passed to the
lazyboy
2012/09/25 21:21:38
For the embedder, the TabContents's PrefsTabHelper
Charlie Reis
2012/09/25 23:19:25
Ah, now we're getting somewhere. It's interesting
| |
106 | |
107 guest_renderer_prefs->throttle_input_events = false; | |
102 AddGuest(instance_id, guest_web_contents, frame_id); | 108 AddGuest(instance_id, guest_web_contents, frame_id); |
103 guest_web_contents->SetDelegate(guest); | 109 guest_web_contents->SetDelegate(guest); |
104 } else { | 110 } else { |
105 guest_web_contents = | 111 guest_web_contents = |
106 static_cast<WebContentsImpl*>(guest->GetWebContents()); | 112 static_cast<WebContentsImpl*>(guest->GetWebContents()); |
107 } | 113 } |
108 | 114 |
109 // We ignore loading empty urls in web_contents. | 115 // We ignore loading empty urls in web_contents. |
110 // If a guest sets empty src attribute after it has navigated to some | 116 // If a guest sets empty src attribute after it has navigated to some |
111 // non-empty page, the action is considered no-op. | 117 // non-empty page, the action is considered no-op. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 bool visible = *Details<bool>(details).ptr(); | 241 bool visible = *Details<bool>(details).ptr(); |
236 WebContentsVisibilityChanged(visible); | 242 WebContentsVisibilityChanged(visible); |
237 break; | 243 break; |
238 } | 244 } |
239 default: | 245 default: |
240 NOTREACHED() << "Unexpected notification type: " << type; | 246 NOTREACHED() << "Unexpected notification type: " << type; |
241 } | 247 } |
242 } | 248 } |
243 | 249 |
244 } // namespace content | 250 } // namespace content |
OLD | NEW |