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 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 // Check whether the request should be allowed. If not allowed, we reset the | 846 // Check whether the request should be allowed. If not allowed, we reset the |
847 // URL to something invalid to prevent the request and cause an error. | 847 // URL to something invalid to prevent the request and cause an error. |
848 if (url.SchemeIs(extensions::kExtensionScheme) && | 848 if (url.SchemeIs(extensions::kExtensionScheme) && |
849 !extensions::ResourceRequestPolicy::CanRequestResource( | 849 !extensions::ResourceRequestPolicy::CanRequestResource( |
850 url, | 850 url, |
851 frame, | 851 frame, |
852 transition_type, | 852 transition_type, |
853 extension_dispatcher_->extensions())) { | 853 extension_dispatcher_->extensions())) { |
854 *new_url = GURL(chrome::kExtensionInvalidRequestURL); | 854 *new_url = GURL(chrome::kExtensionInvalidRequestURL); |
855 return true; | 855 return true; |
856 | |
857 } | 856 } |
858 | 857 |
859 if (url.SchemeIs(chrome::kExtensionResourceScheme) && | 858 if (url.SchemeIs(chrome::kExtensionResourceScheme) && |
860 !extensions::ResourceRequestPolicy::CanRequestExtensionResourceScheme( | 859 !extensions::ResourceRequestPolicy::CanRequestExtensionResourceScheme( |
861 url, | 860 url, |
862 frame)) { | 861 frame)) { |
863 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); | 862 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); |
864 return true; | 863 return true; |
865 } | 864 } |
866 | 865 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 } | 1022 } |
1024 | 1023 |
1025 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 1024 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
1026 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 1025 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
1027 #if defined(ENABLE_PLUGINS) | 1026 #if defined(ENABLE_PLUGINS) |
1028 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 1027 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
1029 #endif | 1028 #endif |
1030 } | 1029 } |
1031 | 1030 |
1032 } // namespace chrome | 1031 } // namespace chrome |
OLD | NEW |