| 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 778 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 const GURL& url, | 789 const GURL& url, |
| 790 GURL* new_url) { | 790 GURL* new_url) { |
| 791 // Check whether the request should be allowed. If not allowed, we reset the | 791 // Check whether the request should be allowed. If not allowed, we reset the |
| 792 // URL to something invalid to prevent the request and cause an error. | 792 // URL to something invalid to prevent the request and cause an error. |
| 793 if (url.SchemeIs(chrome::kExtensionScheme) && | 793 if (url.SchemeIs(chrome::kExtensionScheme) && |
| 794 !extensions::ResourceRequestPolicy::CanRequestResource( | 794 !extensions::ResourceRequestPolicy::CanRequestResource( |
| 795 url, | 795 url, |
| 796 frame, | 796 frame, |
| 797 transition_type, | 797 transition_type, |
| 798 extension_dispatcher_->extensions())) { | 798 extension_dispatcher_->extensions())) { |
| 799 *new_url = GURL("chrome-extension://invalid/"); | 799 *new_url = GURL(chrome::kExtensionInvalidRequestURL); |
| 800 return true; | 800 return true; |
| 801 | 801 |
| 802 } | 802 } |
| 803 | 803 |
| 804 if (url.SchemeIs(chrome::kExtensionResourceScheme) && | 804 if (url.SchemeIs(chrome::kExtensionResourceScheme) && |
| 805 !extensions::ResourceRequestPolicy::CanRequestExtensionResourceScheme( | 805 !extensions::ResourceRequestPolicy::CanRequestExtensionResourceScheme( |
| 806 url, | 806 url, |
| 807 frame)) { | 807 frame)) { |
| 808 *new_url = GURL("chrome-extension-resource://invalid/"); | 808 *new_url = GURL(chrome::kExtensionResourceInvalidRequestURL); |
| 809 return true; | 809 return true; |
| 810 } | 810 } |
| 811 | 811 |
| 812 return false; | 812 return false; |
| 813 } | 813 } |
| 814 | 814 |
| 815 bool ChromeContentRendererClient::ShouldPumpEventsDuringCookieMessage() { | 815 bool ChromeContentRendererClient::ShouldPumpEventsDuringCookieMessage() { |
| 816 // We no longer pump messages, even under Chrome Frame. We rely on cookie | 816 // We no longer pump messages, even under Chrome Frame. We rely on cookie |
| 817 // read requests handled by CF not putting up UI or causing other actions | 817 // read requests handled by CF not putting up UI or causing other actions |
| 818 // that would require us to pump messages. This fixes http://crbug.com/110090. | 818 // that would require us to pump messages. This fixes http://crbug.com/110090. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 959 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
| 960 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 960 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
| 961 } | 961 } |
| 962 | 962 |
| 963 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 963 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
| 964 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 964 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
| 965 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 965 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
| 966 } | 966 } |
| 967 | 967 |
| 968 } // namespace chrome | 968 } // namespace chrome |
| OLD | NEW |