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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 10450002: Transfer user agent override info between browser and renderer (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Diff shows what we do downstream Created 8 years, 7 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
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/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 return delegate_; 202 return delegate_;
203 } 203 }
204 204
205 content::SiteInstance* RenderViewHostImpl::GetSiteInstance() const { 205 content::SiteInstance* RenderViewHostImpl::GetSiteInstance() const {
206 return instance_; 206 return instance_;
207 } 207 }
208 208
209 bool RenderViewHostImpl::CreateRenderView(const string16& frame_name, 209 bool RenderViewHostImpl::CreateRenderView(const string16& frame_name,
210 int opener_route_id, 210 int opener_route_id,
211 int32 max_page_id, 211 int32 max_page_id,
212 int embedder_process_id) { 212 int embedder_process_id,
213 const std::string& ua_override) {
213 DCHECK(!IsRenderViewLive()) << "Creating view twice"; 214 DCHECK(!IsRenderViewLive()) << "Creating view twice";
214 215
215 // The process may (if we're sharing a process with another host that already 216 // The process may (if we're sharing a process with another host that already
216 // initialized it) or may not (we have our own process or the old process 217 // initialized it) or may not (we have our own process or the old process
217 // crashed) have been initialized. Calling Init multiple times will be 218 // crashed) have been initialized. Calling Init multiple times will be
218 // ignored, so this is safe. 219 // ignored, so this is safe.
219 if (!GetProcess()->Init()) 220 if (!GetProcess()->Init())
220 return false; 221 return false;
221 DCHECK(GetProcess()->HasConnection()); 222 DCHECK(GetProcess()->HasConnection());
222 DCHECK(GetProcess()->GetBrowserContext()); 223 DCHECK(GetProcess()->GetBrowserContext());
(...skipping 11 matching lines...) Expand all
234 235
235 ViewMsg_New_Params params; 236 ViewMsg_New_Params params;
236 params.parent_window = GetNativeViewId(); 237 params.parent_window = GetNativeViewId();
237 params.renderer_preferences = 238 params.renderer_preferences =
238 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext()); 239 delegate_->GetRendererPrefs(GetProcess()->GetBrowserContext());
239 params.web_preferences = delegate_->GetWebkitPrefs(); 240 params.web_preferences = delegate_->GetWebkitPrefs();
240 params.view_id = GetRoutingID(); 241 params.view_id = GetRoutingID();
241 params.surface_id = surface_id(); 242 params.surface_id = surface_id();
242 params.session_storage_namespace_id = session_storage_namespace_->id(); 243 params.session_storage_namespace_id = session_storage_namespace_->id();
243 params.frame_name = frame_name; 244 params.frame_name = frame_name;
245 params.user_agent_override = ua_override;
244 // Ensure the RenderView sets its opener correctly. 246 // Ensure the RenderView sets its opener correctly.
245 params.opener_route_id = opener_route_id; 247 params.opener_route_id = opener_route_id;
246 params.swapped_out = is_swapped_out_; 248 params.swapped_out = is_swapped_out_;
247 params.next_page_id = next_page_id; 249 params.next_page_id = next_page_id;
248 #if defined(OS_POSIX) || defined(USE_AURA) 250 #if defined(OS_POSIX) || defined(USE_AURA)
249 if (GetView()) { 251 if (GetView()) {
250 static_cast<content::RenderWidgetHostViewPort*>( 252 static_cast<content::RenderWidgetHostViewPort*>(
251 GetView())->GetScreenInfo(&params.screen_info); 253 GetView())->GetScreenInfo(&params.screen_info);
252 } else { 254 } else {
253 content::RenderWidgetHostViewPort::GetDefaultScreenInfo( 255 content::RenderWidgetHostViewPort::GetDefaultScreenInfo(
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
1837 // can cause navigations to be ignored in OnMsgNavigate. 1839 // can cause navigations to be ignored in OnMsgNavigate.
1838 is_waiting_for_beforeunload_ack_ = false; 1840 is_waiting_for_beforeunload_ack_ = false;
1839 is_waiting_for_unload_ack_ = false; 1841 is_waiting_for_unload_ack_ = false;
1840 } 1842 }
1841 1843
1842 void RenderViewHostImpl::ClearPowerSaveBlockers() { 1844 void RenderViewHostImpl::ClearPowerSaveBlockers() {
1843 STLDeleteValues(&power_save_blockers_); 1845 STLDeleteValues(&power_save_blockers_);
1844 } 1846 }
1845 1847
1846 } // namespace content 1848 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698