| 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 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 } | 634 } |
| 635 } | 635 } |
| 636 | 636 |
| 637 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { | 637 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { |
| 638 return !extension_dispatcher_->is_extension_process(); | 638 return !extension_dispatcher_->is_extension_process(); |
| 639 } | 639 } |
| 640 | 640 |
| 641 bool ChromeContentRendererClient::AllowPopup(const GURL& creator) { | 641 bool ChromeContentRendererClient::AllowPopup(const GURL& creator) { |
| 642 ChromeV8Context* current_context = | 642 ChromeV8Context* current_context = |
| 643 extension_dispatcher_->v8_context_set().GetCurrent(); | 643 extension_dispatcher_->v8_context_set().GetCurrent(); |
| 644 return current_context && !current_context->extension_id().empty(); | 644 return current_context && current_context->extension(); |
| 645 } | 645 } |
| 646 | 646 |
| 647 bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, | 647 bool ChromeContentRendererClient::ShouldFork(WebFrame* frame, |
| 648 const GURL& url, | 648 const GURL& url, |
| 649 bool is_initial_navigation, | 649 bool is_initial_navigation, |
| 650 bool* send_referrer) { | 650 bool* send_referrer) { |
| 651 DCHECK(!frame->parent()); | 651 DCHECK(!frame->parent()); |
| 652 | 652 |
| 653 // If |url| matches one of the prerendered URLs, stop this navigation and try | 653 // If |url| matches one of the prerendered URLs, stop this navigation and try |
| 654 // to swap in the prerendered page on the browser process. If the prerendered | 654 // to swap in the prerendered page on the browser process. If the prerendered |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 859 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
| 860 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 860 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
| 861 } | 861 } |
| 862 | 862 |
| 863 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 863 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
| 864 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 864 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
| 865 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 865 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
| 866 } | 866 } |
| 867 | 867 |
| 868 } // namespace chrome | 868 } // namespace chrome |
| OLD | NEW |