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

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: Add focus ring color prefs too. Created 8 years, 3 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 guest_web_contents->GetMutableRendererPrefs()->
101 throttle_input_events = false; 101 throttle_input_events = false;
102 #if defined(TOOLKIT_GTK)
Fady Samuel 2012/09/21 23:27:12 Is it worthwhile to just copy the struct on all pl
103 // Copy selection color and caret blink rate prefs from embedder, otherwise
104 // things don't work on gtk.
105 content::RendererPreferences* embedder_renderer_prefs =
106 web_contents()->GetMutableRendererPrefs();
107 content::RendererPreferences* guest_renderer_prefs =
108 guest_web_contents->GetMutableRendererPrefs();
109
110 guest_renderer_prefs->active_selection_bg_color =
111 embedder_renderer_prefs->active_selection_bg_color;
112 guest_renderer_prefs->active_selection_fg_color =
113 embedder_renderer_prefs->active_selection_fg_color;
114 guest_renderer_prefs->inactive_selection_bg_color =
115 embedder_renderer_prefs->inactive_selection_bg_color;
116 guest_renderer_prefs->inactive_selection_fg_color =
117 embedder_renderer_prefs->inactive_selection_fg_color;
118
119 guest_renderer_prefs->caret_blink_interval =
120 embedder_renderer_prefs->caret_blink_interval;
121 guest_renderer_prefs->focus_ring_color =
122 embedder_renderer_prefs->focus_ring_color;
123 #endif
124
102 AddGuest(instance_id, guest_web_contents, frame_id); 125 AddGuest(instance_id, guest_web_contents, frame_id);
103 guest_web_contents->SetDelegate(guest); 126 guest_web_contents->SetDelegate(guest);
104 } else { 127 } else {
105 guest_web_contents = static_cast<WebContentsImpl*>(guest->web_contents()); 128 guest_web_contents = static_cast<WebContentsImpl*>(guest->web_contents());
106 } 129 }
107 130
108 // We ignore loading empty urls in web_contents. 131 // We ignore loading empty urls in web_contents.
109 // If a guest sets empty src attribute after it has navigated to some 132 // If a guest sets empty src attribute after it has navigated to some
110 // non-empty page, the action is considered no-op. 133 // non-empty page, the action is considered no-op.
111 // TODO(lazyboy): The js shim for browser-plugin might need to reflect empty 134 // TODO(lazyboy): The js shim for browser-plugin might need to reflect empty
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 bool visible = *Details<bool>(details).ptr(); 257 bool visible = *Details<bool>(details).ptr();
235 WebContentsVisibilityChanged(visible); 258 WebContentsVisibilityChanged(visible);
236 break; 259 break;
237 } 260 }
238 default: 261 default:
239 NOTREACHED() << "Unexpected notification type: " << type; 262 NOTREACHED() << "Unexpected notification type: " << type;
240 } 263 }
241 } 264 }
242 265
243 } // namespace content 266 } // 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