OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 3111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3122 params.source_routing_id = source_view->routing_id(); | 3122 params.source_routing_id = source_view->routing_id(); |
3123 } | 3123 } |
3124 | 3124 |
3125 Send(new ViewHostMsg_RouteMessageEvent(render_view_->routing_id_, params)); | 3125 Send(new ViewHostMsg_RouteMessageEvent(render_view_->routing_id_, params)); |
3126 return true; | 3126 return true; |
3127 } | 3127 } |
3128 | 3128 |
3129 blink::WebString RenderFrameImpl::userAgentOverride(blink::WebLocalFrame* frame, | 3129 blink::WebString RenderFrameImpl::userAgentOverride(blink::WebLocalFrame* frame, |
3130 const blink::WebURL& url) { | 3130 const blink::WebURL& url) { |
3131 DCHECK(!frame_ || frame_ == frame); | 3131 DCHECK(!frame_ || frame_ == frame); |
| 3132 std::string user_agent_override_for_url = |
| 3133 GetContentClient()->renderer()->GetUserAgentOverrideForURL(GURL(url)); |
| 3134 if (!user_agent_override_for_url.empty()) |
| 3135 return WebString::fromUTF8(user_agent_override_for_url); |
| 3136 |
3132 if (!render_view_->webview() || !render_view_->webview()->mainFrame() || | 3137 if (!render_view_->webview() || !render_view_->webview()->mainFrame() || |
3133 render_view_->renderer_preferences_.user_agent_override.empty()) { | 3138 render_view_->renderer_preferences_.user_agent_override.empty()) { |
3134 return blink::WebString(); | 3139 return blink::WebString(); |
3135 } | 3140 } |
3136 | 3141 |
3137 // If we're in the middle of committing a load, the data source we need | 3142 // If we're in the middle of committing a load, the data source we need |
3138 // will still be provisional. | 3143 // will still be provisional. |
3139 WebFrame* main_frame = render_view_->webview()->mainFrame(); | 3144 WebFrame* main_frame = render_view_->webview()->mainFrame(); |
3140 WebDataSource* data_source = NULL; | 3145 WebDataSource* data_source = NULL; |
3141 if (main_frame->provisionalDataSource()) | 3146 if (main_frame->provisionalDataSource()) |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3929 | 3934 |
3930 #if defined(ENABLE_BROWSER_CDMS) | 3935 #if defined(ENABLE_BROWSER_CDMS) |
3931 RendererCdmManager* RenderFrameImpl::GetCdmManager() { | 3936 RendererCdmManager* RenderFrameImpl::GetCdmManager() { |
3932 if (!cdm_manager_) | 3937 if (!cdm_manager_) |
3933 cdm_manager_ = new RendererCdmManager(this); | 3938 cdm_manager_ = new RendererCdmManager(this); |
3934 return cdm_manager_; | 3939 return cdm_manager_; |
3935 } | 3940 } |
3936 #endif // defined(ENABLE_BROWSER_CDMS) | 3941 #endif // defined(ENABLE_BROWSER_CDMS) |
3937 | 3942 |
3938 } // namespace content | 3943 } // namespace content |
OLD | NEW |