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

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

Issue 444843002: Cache the current WebPreferences on RenderViewHostImpl (try #2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 6 years, 4 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 | Annotate | Revision Log
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_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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 208
209 // Create a swapped out RenderView for the guest in the embedder render 209 // Create a swapped out RenderView for the guest in the embedder render
210 // process, so that the embedder can access the guest's window object. 210 // process, so that the embedder can access the guest's window object.
211 int guest_routing_id = 211 int guest_routing_id =
212 GetWebContents()->CreateSwappedOutRenderView( 212 GetWebContents()->CreateSwappedOutRenderView(
213 embedder_web_contents_->GetSiteInstance()); 213 embedder_web_contents_->GetSiteInstance());
214 SendMessageToEmbedder( 214 SendMessageToEmbedder(
215 new BrowserPluginMsg_GuestContentWindowReady(instance_id_, 215 new BrowserPluginMsg_GuestContentWindowReady(instance_id_,
216 guest_routing_id)); 216 guest_routing_id));
217 217
218 WebPreferences prefs = GetWebContents()->GetWebkitPrefs(); 218 // TODO(chrishtr): this code is wrong. The navigate_on_drag_drop field will
219 // be reset again the next time preferences are updated.
220 WebPreferences prefs =
221 GetWebContents()->GetRenderViewHost()->GetWebkitPreferences();
219 prefs.navigate_on_drag_drop = false; 222 prefs.navigate_on_drag_drop = false;
220 GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs); 223 GetWebContents()->GetRenderViewHost()->UpdateWebkitPreferences(prefs);
221 224
222 // Enable input method for guest if it's enabled for the embedder. 225 // Enable input method for guest if it's enabled for the embedder.
223 if (static_cast<RenderViewHostImpl*>( 226 if (static_cast<RenderViewHostImpl*>(
224 embedder_web_contents_->GetRenderViewHost())->input_method_active()) { 227 embedder_web_contents_->GetRenderViewHost())->input_method_active()) {
225 RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( 228 RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>(
226 GetWebContents()->GetRenderViewHost()); 229 GetWebContents()->GetRenderViewHost());
227 guest_rvh->SetInputMethodActive(true); 230 guest_rvh->SetInputMethodActive(true);
228 } 231 }
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 void BrowserPluginGuest::OnImeCompositionRangeChanged( 837 void BrowserPluginGuest::OnImeCompositionRangeChanged(
835 const gfx::Range& range, 838 const gfx::Range& range,
836 const std::vector<gfx::Rect>& character_bounds) { 839 const std::vector<gfx::Rect>& character_bounds) {
837 static_cast<RenderWidgetHostViewBase*>( 840 static_cast<RenderWidgetHostViewBase*>(
838 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( 841 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged(
839 range, character_bounds); 842 range, character_bounds);
840 } 843 }
841 #endif 844 #endif
842 845
843 } // namespace content 846 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_settings.cc ('k') | content/browser/frame_host/interstitial_page_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698