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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "content/browser/browser_plugin/browser_plugin_embedder_helper.h" | 9 #include "content/browser/browser_plugin/browser_plugin_embedder_helper.h" |
10 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 10 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 MSG_ROUTING_NONE, | 106 MSG_ROUTING_NONE, |
107 NULL // base WebContents | 107 NULL // base WebContents |
108 )); | 108 )); |
109 | 109 |
110 guest = guest_web_contents->SetBrowserPluginGuest(instance_id); | 110 guest = guest_web_contents->SetBrowserPluginGuest(instance_id); |
111 guest->set_embedder_render_process_host( | 111 guest->set_embedder_render_process_host( |
112 render_view_host->GetProcess()); | 112 render_view_host->GetProcess()); |
113 | 113 |
114 guest_web_contents->GetMutableRendererPrefs()-> | 114 guest_web_contents->GetMutableRendererPrefs()-> |
115 throttle_input_events = false; | 115 throttle_input_events = false; |
116 | |
117 #if defined(TOOLKIT_GTK) | |
Fady Samuel
2012/09/06 21:21:07
Why should this be GTK only? Why not copy all the
lazyboy
2012/09/08 02:38:55
It's only GTK that uses the renderer_prefs->color
| |
118 // Copy selection color and caret blink rate prefs from embedder, otherwise | |
119 // things don't work on gtk. | |
120 content::RendererPreferences* embedder_renderer_prefs = | |
121 web_contents()->GetMutableRendererPrefs(); | |
122 content::RendererPreferences* guest_renderer_prefs = | |
123 guest_web_contents->GetMutableRendererPrefs(); | |
124 | |
125 guest_renderer_prefs->active_selection_bg_color = | |
126 embedder_renderer_prefs->active_selection_bg_color; | |
127 guest_renderer_prefs->active_selection_fg_color = | |
128 embedder_renderer_prefs->active_selection_fg_color; | |
129 guest_renderer_prefs->inactive_selection_bg_color = | |
130 embedder_renderer_prefs->inactive_selection_bg_color; | |
131 guest_renderer_prefs->inactive_selection_fg_color = | |
132 embedder_renderer_prefs->inactive_selection_fg_color; | |
133 | |
134 guest_renderer_prefs->caret_blink_interval = | |
135 embedder_renderer_prefs->caret_blink_interval; | |
136 #endif | |
137 | |
116 AddGuest(instance_id, guest, frame_id); | 138 AddGuest(instance_id, guest, frame_id); |
117 guest_web_contents->SetDelegate(guest); | 139 guest_web_contents->SetDelegate(guest); |
118 } else { | 140 } else { |
119 guest_web_contents = static_cast<WebContentsImpl*>(guest->web_contents()); | 141 guest_web_contents = static_cast<WebContentsImpl*>(guest->web_contents()); |
120 } | 142 } |
121 guest_web_contents->GetController().LoadURL(url, | 143 guest_web_contents->GetController().LoadURL(url, |
122 Referrer(), | 144 Referrer(), |
123 PAGE_TRANSITION_AUTO_SUBFRAME, | 145 PAGE_TRANSITION_AUTO_SUBFRAME, |
124 std::string()); | 146 std::string()); |
125 if (!size.IsEmpty()) | 147 if (!size.IsEmpty()) |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
278 default: | 300 default: |
279 NOTREACHED() << "Unexpected notification type: " << type; | 301 NOTREACHED() << "Unexpected notification type: " << type; |
280 } | 302 } |
281 } | 303 } |
282 | 304 |
283 bool BrowserPluginEmbedder::IsForRenderViewHost(RenderViewHost* rvh) { | 305 bool BrowserPluginEmbedder::IsForRenderViewHost(RenderViewHost* rvh) { |
284 return render_view_host_ == rvh; | 306 return render_view_host_ == rvh; |
285 } | 307 } |
286 | 308 |
287 } // namespace content | 309 } // namespace content |
OLD | NEW |