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() != extensions::Feature::WEB_PAGE_CONTEXT; | |
Aaron Boodman
2012/09/25 21:42:57
A whitelist would be better. == BLESSED_EXTENSION_
| |
729 } | 730 } |
730 | 731 |
731 bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, | 732 bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, |
732 const GURL& url, | 733 const GURL& url, |
733 bool is_initial_navigation, | 734 bool is_initial_navigation, |
734 bool* send_referrer) { | 735 bool* send_referrer) { |
735 DCHECK(!frame->parent()); | 736 DCHECK(!frame->parent()); |
736 | 737 |
737 // If |url| matches one of the prerendered URLs, stop this navigation and try | 738 // 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 | 739 // 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() { | 960 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
960 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 961 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
961 } | 962 } |
962 | 963 |
963 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 964 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
964 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 965 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
965 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 966 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
966 } | 967 } |
967 | 968 |
968 } // namespace chrome | 969 } // namespace chrome |
OLD | NEW |