Chromium Code Reviews| 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 598 // code when PNaCl ships. | 598 // code when PNaCl ships. |
| 599 bool is_whitelisted_url = | 599 bool is_whitelisted_url = |
| 600 ((top_url.SchemeIs("http") || top_url.SchemeIs("https")) && | 600 ((top_url.SchemeIs("http") || top_url.SchemeIs("https")) && |
| 601 (top_url.host() == "plus.google.com" || | 601 (top_url.host() == "plus.google.com" || |
| 602 top_url.host() == "plus.sandbox.google.com") && | 602 top_url.host() == "plus.sandbox.google.com") && |
| 603 top_url.path().find("/games") == 0); | 603 top_url.path().find("/games") == 0); |
| 604 | 604 |
| 605 // Allow Chrome Web Store extensions, built-in extensions, extensions | 605 // Allow Chrome Web Store extensions, built-in extensions, extensions |
| 606 // under development, invocations from whitelisted URLs, and all invocations | 606 // under development, invocations from whitelisted URLs, and all invocations |
| 607 // if --enable-nacl is set. | 607 // if --enable-nacl is set. |
| 608 #ifdef __arm__ | |
| 609 // Since the ARM ABI is not quite stable, so only allow NaCl for | |
| 610 // unrestricted extensions (i.e. built-in and under development). | |
| 611 // TODO(dschuff): remove this when the ABI is stable | |
| 612 bool is_nacl_allowed = is_extension_unrestricted || is_nacl_unrestricted; | |
| 613 #else | |
| 608 bool is_nacl_allowed = | 614 bool is_nacl_allowed = |
| 609 is_extension_from_webstore || | 615 is_extension_from_webstore || |
| 610 is_extension_unrestricted || | 616 is_extension_unrestricted || |
| 611 is_whitelisted_url || | 617 is_whitelisted_url || |
| 612 is_nacl_unrestricted; | 618 is_nacl_unrestricted; |
| 619 #endif | |
|
Nico
2012/08/29 17:08:15
Can you write this as:
bool is_nacl_allowed =
#if
Derek Schuff
2012/08/29 17:32:41
Done.
| |
| 613 if (is_nacl_allowed) { | 620 if (is_nacl_allowed) { |
| 614 bool app_can_use_dev_interfaces = | 621 bool app_can_use_dev_interfaces = |
| 615 // NaCl PDF viewer extension | 622 // NaCl PDF viewer extension |
| 616 (is_extension_from_webstore && | 623 (is_extension_from_webstore && |
| 617 manifest_url.SchemeIs("chrome-extension") && | 624 manifest_url.SchemeIs("chrome-extension") && |
| 618 manifest_url.host() == "acadkphlmlegjaadjagenfimbpphcgnh"); | 625 manifest_url.host() == "acadkphlmlegjaadjagenfimbpphcgnh"); |
| 619 // Make sure that PPAPI 'dev' interfaces aren't available for production | 626 // Make sure that PPAPI 'dev' interfaces aren't available for production |
| 620 // apps unless they're whitelisted. | 627 // apps unless they're whitelisted. |
| 621 WebString dev_attribute = WebString::fromUTF8("@dev"); | 628 WebString dev_attribute = WebString::fromUTF8("@dev"); |
| 622 if ((!is_whitelisted_url && !is_extension_from_webstore) || | 629 if ((!is_whitelisted_url && !is_extension_from_webstore) || |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 952 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 959 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
| 953 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 960 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
| 954 } | 961 } |
| 955 | 962 |
| 956 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 963 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
| 957 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 964 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
| 958 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 965 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
| 959 } | 966 } |
| 960 | 967 |
| 961 } // namespace chrome | 968 } // namespace chrome |
| OLD | NEW |