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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 bool ChromeContentRendererClient::IsNaClAllowed( | 666 bool ChromeContentRendererClient::IsNaClAllowed( |
667 const GURL& manifest_url, | 667 const GURL& manifest_url, |
668 const GURL& top_url, | 668 const GURL& top_url, |
669 bool is_nacl_unrestricted, | 669 bool is_nacl_unrestricted, |
670 bool is_extension_unrestricted, | 670 bool is_extension_unrestricted, |
671 bool is_extension_from_webstore, | 671 bool is_extension_from_webstore, |
672 WebPluginParams* params) { | 672 WebPluginParams* params) { |
673 // Temporarily allow these URLs to run NaCl apps. We should remove this | 673 // Temporarily allow these URLs to run NaCl apps. We should remove this |
674 // code when PNaCl ships. | 674 // code when PNaCl ships. |
675 bool is_whitelisted_url = | 675 bool is_whitelisted_url = |
676 ((top_url.SchemeIs("http") || top_url.SchemeIs("https")) && | 676 top_url.SchemeIs("https") && |
677 (top_url.host() == "plus.google.com" || | 677 (top_url.host() == "plus.google.com" || |
678 top_url.host() == "plus.sandbox.google.com") && | 678 top_url.host() == "plus.sandbox.google.com") && |
679 top_url.path().find("/games") == 0); | 679 top_url.path().find("/games") == 0; |
680 | 680 |
681 // Allow Chrome Web Store extensions, built-in extensions, extensions | 681 // Allow Chrome Web Store extensions, built-in extensions, extensions |
682 // under development, invocations from whitelisted URLs, and all invocations | 682 // under development, invocations from whitelisted URLs, and all invocations |
683 // if --enable-nacl is set. | 683 // if --enable-nacl is set. |
684 bool is_nacl_allowed = is_extension_from_webstore || | 684 bool is_nacl_allowed = is_extension_from_webstore || |
685 is_whitelisted_url || | 685 is_whitelisted_url || |
686 is_extension_unrestricted || | 686 is_extension_unrestricted || |
687 is_nacl_unrestricted; | 687 is_nacl_unrestricted; |
688 if (is_nacl_allowed) { | 688 if (is_nacl_allowed) { |
689 bool app_can_use_dev_interfaces = | 689 bool app_can_use_dev_interfaces = |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1055 } | 1055 } |
1056 | 1056 |
1057 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 1057 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
1058 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 1058 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
1059 #if defined(ENABLE_PLUGINS) | 1059 #if defined(ENABLE_PLUGINS) |
1060 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 1060 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
1061 #endif | 1061 #endif |
1062 } | 1062 } |
1063 | 1063 |
1064 } // namespace chrome | 1064 } // namespace chrome |
OLD | NEW |