| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 CHECK(!guest); | 87 CHECK(!guest); |
| 88 | 88 |
| 89 const std::string& host = | 89 const std::string& host = |
| 90 render_view_host->GetSiteInstance()->GetSiteURL().host(); | 90 render_view_host->GetSiteInstance()->GetSiteURL().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(render_view_host->GetProcess()); | 97 guest->set_embedder_web_contents(web_contents()); |
| 98 guest->set_embedder_render_view_host(render_view_host); | |
| 99 | 98 |
| 100 RendererPreferences* guest_renderer_prefs = | 99 RendererPreferences* guest_renderer_prefs = |
| 101 guest_web_contents->GetMutableRendererPrefs(); | 100 guest_web_contents->GetMutableRendererPrefs(); |
| 102 // Copy renderer preferences (and nothing else) from the embedder's | 101 // Copy renderer preferences (and nothing else) from the embedder's |
| 103 // TabContents to the guest. | 102 // TabContents to the guest. |
| 104 // | 103 // |
| 105 // For GTK and Aura this is necessary to get proper renderer configuration | 104 // For GTK and Aura this is necessary to get proper renderer configuration |
| 106 // values for caret blinking interval, colors related to selection and | 105 // values for caret blinking interval, colors related to selection and |
| 107 // focus. | 106 // focus. |
| 108 *guest_renderer_prefs = *web_contents()->GetMutableRendererPrefs(); | 107 *guest_renderer_prefs = *web_contents()->GetMutableRendererPrefs(); |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 bool visible = *Details<bool>(details).ptr(); | 316 bool visible = *Details<bool>(details).ptr(); |
| 318 WebContentsVisibilityChanged(visible); | 317 WebContentsVisibilityChanged(visible); |
| 319 break; | 318 break; |
| 320 } | 319 } |
| 321 default: | 320 default: |
| 322 NOTREACHED() << "Unexpected notification type: " << type; | 321 NOTREACHED() << "Unexpected notification type: " << type; |
| 323 } | 322 } |
| 324 } | 323 } |
| 325 | 324 |
| 326 } // namespace content | 325 } // namespace content |
| OLD | NEW |