| 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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 } | 718 } |
| 719 } | 719 } |
| 720 | 720 |
| 721 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { | 721 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { |
| 722 return !extension_dispatcher_->is_extension_process(); | 722 return !extension_dispatcher_->is_extension_process(); |
| 723 } | 723 } |
| 724 | 724 |
| 725 bool ChromeContentRendererClient::AllowPopup(const GURL& creator) { | 725 bool ChromeContentRendererClient::AllowPopup(const GURL& creator) { |
| 726 extensions::ChromeV8Context* current_context = | 726 extensions::ChromeV8Context* current_context = |
| 727 extension_dispatcher_->v8_context_set().GetCurrent(); | 727 extension_dispatcher_->v8_context_set().GetCurrent(); |
| 728 return current_context && current_context->extension(); | 728 return current_context && current_context->extension() && |
| 729 (current_context->context_type() == |
| 730 extensions::Feature::BLESSED_EXTENSION_CONTEXT || |
| 731 current_context->context_type() == |
| 732 extensions::Feature::CONTENT_SCRIPT_CONTEXT); |
| 729 } | 733 } |
| 730 | 734 |
| 731 bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, | 735 bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, |
| 732 const GURL& url, | 736 const GURL& url, |
| 733 bool is_initial_navigation, | 737 bool is_initial_navigation, |
| 734 bool* send_referrer) { | 738 bool* send_referrer) { |
| 735 DCHECK(!frame->parent()); | 739 DCHECK(!frame->parent()); |
| 736 | 740 |
| 737 // If |url| matches one of the prerendered URLs, stop this navigation and try | 741 // If |url| matches one of the prerendered URLs, stop this navigation and try |
| 738 // to swap in the prerendered page on the browser process. If the prerendered | 742 // to swap in the prerendered page on the browser process. If the prerendered |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 963 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
| 960 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 964 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
| 961 } | 965 } |
| 962 | 966 |
| 963 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 967 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
| 964 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 968 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
| 965 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 969 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
| 966 } | 970 } |
| 967 | 971 |
| 968 } // namespace chrome | 972 } // namespace chrome |
| OLD | NEW |