Chromium Code Reviews| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "base/strings/string_number_conversions.h" | |
| 12 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 13 #include "base/values.h" | 14 #include "base/values.h" |
| 14 #include "chrome/common/child_process_logging.h" | 15 #include "chrome/common/child_process_logging.h" |
| 15 #include "chrome/common/chrome_content_client.h" | 16 #include "chrome/common/chrome_content_client.h" |
| 16 #include "chrome/common/chrome_paths.h" | 17 #include "chrome/common/chrome_paths.h" |
| 17 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 18 #include "chrome/common/content_settings_pattern.h" | 19 #include "chrome/common/content_settings_pattern.h" |
| 19 #include "chrome/common/extensions/chrome_manifest_handlers.h" | 20 #include "chrome/common/extensions/chrome_manifest_handlers.h" |
| 20 #include "chrome/common/extensions/extension.h" | 21 #include "chrome/common/extensions/extension.h" |
| 21 #include "chrome/common/extensions/extension_constants.h" | 22 #include "chrome/common/extensions/extension_constants.h" |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 985 } | 986 } |
| 986 | 987 |
| 987 if (url.SchemeIs(chrome::kExtensionResourceScheme) && | 988 if (url.SchemeIs(chrome::kExtensionResourceScheme) && |
| 988 !extensions::ResourceRequestPolicy::CanRequestExtensionResourceScheme( | 989 !extensions::ResourceRequestPolicy::CanRequestExtensionResourceScheme( |
| 989 url, | 990 url, |
| 990 frame)) { | 991 frame)) { |
| 991 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); | 992 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); |
| 992 return true; | 993 return true; |
| 993 } | 994 } |
| 994 | 995 |
| 996 const content::RenderView* render_view = | |
| 997 content::RenderView::FromWebView(frame->view()); | |
| 998 if (SearchBox* search_box = SearchBox::Get(render_view)) { | |
|
samarth
2013/06/05 22:59:04
nit: I prefer keeping initialization outside of co
kmadhusu
2013/06/06 02:27:38
Done.
| |
| 999 if (url.SchemeIs(chrome::kChromeSearchScheme)) { | |
| 1000 if (url.host() == chrome::kChromeUIThumbnailHost) | |
| 1001 return search_box->GenerateThumbnailURLFromTransientURL(url, new_url); | |
| 1002 else if (url.host() == chrome::kChromeUIFaviconHost) | |
| 1003 return search_box->GenerateFaviconURLFromTransientURL(url, new_url); | |
| 1004 } | |
| 1005 } | |
| 1006 | |
| 995 return false; | 1007 return false; |
| 996 } | 1008 } |
| 997 | 1009 |
| 998 bool ChromeContentRendererClient::ShouldPumpEventsDuringCookieMessage() { | 1010 bool ChromeContentRendererClient::ShouldPumpEventsDuringCookieMessage() { |
| 999 // We no longer pump messages, even under Chrome Frame. We rely on cookie | 1011 // We no longer pump messages, even under Chrome Frame. We rely on cookie |
| 1000 // read requests handled by CF not putting up UI or causing other actions | 1012 // read requests handled by CF not putting up UI or causing other actions |
| 1001 // that would require us to pump messages. This fixes http://crbug.com/110090. | 1013 // that would require us to pump messages. This fixes http://crbug.com/110090. |
| 1002 return false; | 1014 return false; |
| 1003 } | 1015 } |
| 1004 | 1016 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1194 | 1206 |
| 1195 if (container->element().shadowHost().isNull()) | 1207 if (container->element().shadowHost().isNull()) |
| 1196 return false; | 1208 return false; |
| 1197 | 1209 |
| 1198 WebString tag_name = container->element().shadowHost().tagName(); | 1210 WebString tag_name = container->element().shadowHost().tagName(); |
| 1199 return tag_name.equals(WebString::fromUTF8(kWebViewTagName)) || | 1211 return tag_name.equals(WebString::fromUTF8(kWebViewTagName)) || |
| 1200 tag_name.equals(WebString::fromUTF8(kAdViewTagName)); | 1212 tag_name.equals(WebString::fromUTF8(kAdViewTagName)); |
| 1201 } | 1213 } |
| 1202 | 1214 |
| 1203 } // namespace chrome | 1215 } // namespace chrome |
| OLD | NEW |