Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Side by Side Diff: content/browser/browser_plugin/browser_plugin_embedder.cc

Issue 10908099: Copy renderer preferences from embedder to guest. (Closed) Base URL: http://git.chromium.org/chromium/src.git@tmp
Patch Set: Sync to HEAD, diff conflict otherwise. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 render_view_host->GetSiteInstance()->GetSite().host(); 88 render_view_host->GetSiteInstance()->GetSite().host();
89 guest_web_contents = WebContentsImpl::CreateGuest( 89 guest_web_contents = WebContentsImpl::CreateGuest(
90 web_contents()->GetBrowserContext(), 90 web_contents()->GetBrowserContext(),
91 host, 91 host,
92 instance_id); 92 instance_id);
93 93
94 guest = guest_web_contents->GetBrowserPluginGuest(); 94 guest = guest_web_contents->GetBrowserPluginGuest();
95 guest->set_embedder_render_process_host( 95 guest->set_embedder_render_process_host(
96 render_view_host->GetProcess()); 96 render_view_host->GetProcess());
97 97
98 guest_web_contents->GetMutableRendererPrefs()-> 98 RendererPreferences* guest_renderer_prefs =
99 throttle_input_events = false; 99 guest_web_contents->GetMutableRendererPrefs();
100 // Copy renderer preferences (and nothing else) from the embedder's
101 // TabContents to the guest.
102 //
103 // For GTK and Aura this is necessary to get proper renderer configuration
104 // values for caret blinking interval, colors related to selection and
105 // focus.
106 *guest_renderer_prefs = *web_contents()->GetMutableRendererPrefs();
107
108 guest_renderer_prefs->throttle_input_events = false;
100 AddGuest(instance_id, guest_web_contents); 109 AddGuest(instance_id, guest_web_contents);
101 guest_web_contents->SetDelegate(guest); 110 guest_web_contents->SetDelegate(guest);
102 } else { 111 } else {
103 guest_web_contents = 112 guest_web_contents =
104 static_cast<WebContentsImpl*>(guest->GetWebContents()); 113 static_cast<WebContentsImpl*>(guest->GetWebContents());
105 } 114 }
106 115
107 // We ignore loading empty urls in web_contents. 116 // We ignore loading empty urls in web_contents.
108 // If a guest sets empty src attribute after it has navigated to some 117 // If a guest sets empty src attribute after it has navigated to some
109 // non-empty page, the action is considered no-op. 118 // non-empty page, the action is considered no-op.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 bool visible = *Details<bool>(details).ptr(); 242 bool visible = *Details<bool>(details).ptr();
234 WebContentsVisibilityChanged(visible); 243 WebContentsVisibilityChanged(visible);
235 break; 244 break;
236 } 245 }
237 default: 246 default:
238 NOTREACHED() << "Unexpected notification type: " << type; 247 NOTREACHED() << "Unexpected notification type: " << type;
239 } 248 }
240 } 249 }
241 250
242 } // namespace content 251 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698