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 WebPreferences prefs = GetWebContents()->GetWebkitPrefs(); | 226 // TODO(chrishtr): this code is wrong. The navigate_on_drag_drop field will |
| 227 // be reset again the next time preferences are updated. |
| 228 WebPreferences prefs = |
| 229 GetWebContents()->GetRenderViewHost()->GetWebkitPreferences(); |
227 prefs.navigate_on_drag_drop = false; | 230 prefs.navigate_on_drag_drop = false; |
228 GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs); | 231 GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs); |
229 | 232 |
230 // Enable input method for guest if it's enabled for the embedder. | 233 // Enable input method for guest if it's enabled for the embedder. |
231 if (static_cast<RenderViewHostImpl*>( | 234 if (static_cast<RenderViewHostImpl*>( |
232 embedder_web_contents_->GetRenderViewHost())->input_method_active()) { | 235 embedder_web_contents_->GetRenderViewHost())->input_method_active()) { |
233 RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( | 236 RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( |
234 GetWebContents()->GetRenderViewHost()); | 237 GetWebContents()->GetRenderViewHost()); |
235 guest_rvh->SetInputMethodActive(true); | 238 guest_rvh->SetInputMethodActive(true); |
236 } | 239 } |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 892 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
890 const gfx::Range& range, | 893 const gfx::Range& range, |
891 const std::vector<gfx::Rect>& character_bounds) { | 894 const std::vector<gfx::Rect>& character_bounds) { |
892 static_cast<RenderWidgetHostViewBase*>( | 895 static_cast<RenderWidgetHostViewBase*>( |
893 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 896 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
894 range, character_bounds); | 897 range, character_bounds); |
895 } | 898 } |
896 #endif | 899 #endif |
897 | 900 |
898 } // namespace content | 901 } // namespace content |
OLD | NEW |