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 "chrome/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // Treat CDM invocations like JavaScript. | 215 // Treat CDM invocations like JavaScript. |
216 if (plugin.name == ASCIIToUTF16(kWidevineCdmPluginName)) { | 216 if (plugin.name == ASCIIToUTF16(kWidevineCdmPluginName)) { |
217 DCHECK(plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS); | 217 DCHECK(plugin.type == WebPluginInfo::PLUGIN_TYPE_PEPPER_OUT_OF_PROCESS); |
218 return true; | 218 return true; |
219 } | 219 } |
220 #endif // WIDEVINE_CDM_AVAILABLE | 220 #endif // WIDEVINE_CDM_AVAILABLE |
221 | 221 |
222 return false; | 222 return false; |
223 } | 223 } |
224 | 224 |
225 content::RenderView* GetRenderViewFromWebFrame(WebKit::WebFrame* webframe) { | |
226 if (!webframe) | |
227 return NULL; | |
228 WebKit::WebView* webview = webframe->view(); | |
229 if (!webview) | |
230 return NULL; | |
231 return content::RenderView::FromWebView(webview); | |
232 } | |
233 | |
234 } // namespace | 225 } // namespace |
235 | 226 |
236 namespace chrome { | 227 namespace chrome { |
237 | 228 |
238 ChromeContentRendererClient::ChromeContentRendererClient() { | 229 ChromeContentRendererClient::ChromeContentRendererClient() { |
239 g_current_client = this; | 230 g_current_client = this; |
240 } | 231 } |
241 | 232 |
242 ChromeContentRendererClient::~ChromeContentRendererClient() { | 233 ChromeContentRendererClient::~ChromeContentRendererClient() { |
243 g_current_client = NULL; | 234 g_current_client = NULL; |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 } | 981 } |
991 | 982 |
992 if (url.SchemeIs(chrome::kExtensionResourceScheme) && | 983 if (url.SchemeIs(chrome::kExtensionResourceScheme) && |
993 !extensions::ResourceRequestPolicy::CanRequestExtensionResourceScheme( | 984 !extensions::ResourceRequestPolicy::CanRequestExtensionResourceScheme( |
994 url, | 985 url, |
995 frame)) { | 986 frame)) { |
996 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); | 987 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); |
997 return true; | 988 return true; |
998 } | 989 } |
999 | 990 |
1000 const content::RenderView* render_view = GetRenderViewFromWebFrame(frame); | |
1001 if (SearchBox* search_box = SearchBox::Get(render_view)) { | |
1002 if (url.SchemeIs(chrome::kChromeSearchScheme) && | |
1003 url.host() == chrome::kChromeSearchSuggestionHost) { | |
1004 if (search_box->GenerateDataURLForSuggestionRequest(url, new_url)) | |
1005 return true; | |
1006 } | |
1007 } | |
1008 | |
1009 return false; | 991 return false; |
1010 } | 992 } |
1011 | 993 |
1012 bool ChromeContentRendererClient::ShouldPumpEventsDuringCookieMessage() { | 994 bool ChromeContentRendererClient::ShouldPumpEventsDuringCookieMessage() { |
1013 // We no longer pump messages, even under Chrome Frame. We rely on cookie | 995 // We no longer pump messages, even under Chrome Frame. We rely on cookie |
1014 // read requests handled by CF not putting up UI or causing other actions | 996 // read requests handled by CF not putting up UI or causing other actions |
1015 // that would require us to pump messages. This fixes http://crbug.com/110090. | 997 // that would require us to pump messages. This fixes http://crbug.com/110090. |
1016 return false; | 998 return false; |
1017 } | 999 } |
1018 | 1000 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 | 1211 |
1230 for (size_t i = 0; i < request_os_file_handle_allowed_hosts_.size(); ++i) { | 1212 for (size_t i = 0; i < request_os_file_handle_allowed_hosts_.size(); ++i) { |
1231 if (MatchPattern(inner.host(), request_os_file_handle_allowed_hosts_[i])) | 1213 if (MatchPattern(inner.host(), request_os_file_handle_allowed_hosts_[i])) |
1232 return true; | 1214 return true; |
1233 } | 1215 } |
1234 | 1216 |
1235 return false; | 1217 return false; |
1236 } | 1218 } |
1237 | 1219 |
1238 } // namespace chrome | 1220 } // namespace chrome |
OLD | NEW |