Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / renderer / extensions / renderer_permissions_policy_delegate.cc
index 0f751b2..73a1c73 100644 (file)
@@ -10,6 +10,7 @@
 #include "chrome/renderer/extensions/dispatcher.h"
 #include "extensions/common/extensions_client.h"
 #include "extensions/common/manifest_constants.h"
+#include "extensions/common/switches.h"
 
 namespace extensions {
 
@@ -38,13 +39,15 @@ bool RendererPermissionsPolicyDelegate::CanExecuteScriptOnPage(
     return true;
   }
 
-  if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSigninProcess)) {
+  CommandLine* command_line = CommandLine::ForCurrentProcess();
+  if (command_line->HasSwitch(::switches::kSigninProcess)) {
     if (error)
       *error = errors::kCannotScriptSigninPage;
     return false;
   }
 
-  if (dispatcher_->IsExtensionActive(extension_misc::kWebStoreAppId)) {
+  if (dispatcher_->IsExtensionActive(extension_misc::kWebStoreAppId) &&
+      !command_line->HasSwitch(switches::kAllowScriptingGallery)) {
     if (error)
       *error = errors::kCannotScriptGallery;
     return false;