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_guest.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 // Create a swapped out RenderView for the guest in the embedder render | 217 // Create a swapped out RenderView for the guest in the embedder render |
218 // process, so that the embedder can access the guest's window object. | 218 // process, so that the embedder can access the guest's window object. |
219 int guest_routing_id = | 219 int guest_routing_id = |
220 GetWebContents()->CreateSwappedOutRenderView( | 220 GetWebContents()->CreateSwappedOutRenderView( |
221 embedder_web_contents_->GetSiteInstance()); | 221 embedder_web_contents_->GetSiteInstance()); |
222 SendMessageToEmbedder( | 222 SendMessageToEmbedder( |
223 new BrowserPluginMsg_GuestContentWindowReady(instance_id_, | 223 new BrowserPluginMsg_GuestContentWindowReady(instance_id_, |
224 guest_routing_id)); | 224 guest_routing_id)); |
225 | 225 |
226 // TODO(chrishtr): this code is wrong. The navigate_on_drag_drop field will | 226 WebPreferences prefs = GetWebContents()->GetWebkitPrefs(); |
227 // be reset again the next time preferences are updated. | |
228 WebPreferences prefs = | |
229 GetWebContents()->GetRenderViewHost()->GetWebkitPreferences(); | |
230 prefs.navigate_on_drag_drop = false; | 227 prefs.navigate_on_drag_drop = false; |
231 GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs); | 228 GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs); |
232 | 229 |
233 // Enable input method for guest if it's enabled for the embedder. | 230 // Enable input method for guest if it's enabled for the embedder. |
234 if (static_cast<RenderViewHostImpl*>( | 231 if (static_cast<RenderViewHostImpl*>( |
235 embedder_web_contents_->GetRenderViewHost())->input_method_active()) { | 232 embedder_web_contents_->GetRenderViewHost())->input_method_active()) { |
236 RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( | 233 RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( |
237 GetWebContents()->GetRenderViewHost()); | 234 GetWebContents()->GetRenderViewHost()); |
238 guest_rvh->SetInputMethodActive(true); | 235 guest_rvh->SetInputMethodActive(true); |
239 } | 236 } |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 889 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
893 const gfx::Range& range, | 890 const gfx::Range& range, |
894 const std::vector<gfx::Rect>& character_bounds) { | 891 const std::vector<gfx::Rect>& character_bounds) { |
895 static_cast<RenderWidgetHostViewBase*>( | 892 static_cast<RenderWidgetHostViewBase*>( |
896 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 893 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
897 range, character_bounds); | 894 range, character_bounds); |
898 } | 895 } |
899 #endif | 896 #endif |
900 | 897 |
901 } // namespace content | 898 } // namespace content |
OLD | NEW |