| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extensions/renderer_permissions_policy_delegate.h" | 5 #include "chrome/renderer/extensions/renderer_permissions_policy_delegate.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | |
| 8 #include "chrome/common/chrome_switches.h" | |
| 9 #include "chrome/common/extensions/extension_constants.h" | 7 #include "chrome/common/extensions/extension_constants.h" |
| 10 #include "extensions/common/constants.h" | 8 #include "extensions/common/constants.h" |
| 11 #include "extensions/common/extensions_client.h" | 9 #include "extensions/common/extensions_client.h" |
| 12 #include "extensions/common/manifest_constants.h" | 10 #include "extensions/common/manifest_constants.h" |
| 13 #include "extensions/common/switches.h" | 11 #include "extensions/common/switches.h" |
| 14 #include "extensions/renderer/dispatcher.h" | 12 #include "extensions/renderer/dispatcher.h" |
| 15 | 13 |
| 16 namespace extensions { | 14 namespace extensions { |
| 17 | 15 |
| 18 namespace errors = manifest_errors; | 16 namespace errors = manifest_errors; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 32 int tab_id, | 30 int tab_id, |
| 33 int process_id, | 31 int process_id, |
| 34 std::string* error) { | 32 std::string* error) { |
| 35 const ExtensionsClient::ScriptingWhitelist& whitelist = | 33 const ExtensionsClient::ScriptingWhitelist& whitelist = |
| 36 ExtensionsClient::Get()->GetScriptingWhitelist(); | 34 ExtensionsClient::Get()->GetScriptingWhitelist(); |
| 37 if (std::find(whitelist.begin(), whitelist.end(), extension->id()) != | 35 if (std::find(whitelist.begin(), whitelist.end(), extension->id()) != |
| 38 whitelist.end()) { | 36 whitelist.end()) { |
| 39 return true; | 37 return true; |
| 40 } | 38 } |
| 41 | 39 |
| 42 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 43 if (command_line->HasSwitch(::switches::kSigninProcess)) { | |
| 44 if (error) | |
| 45 *error = errors::kCannotScriptSigninPage; | |
| 46 return false; | |
| 47 } | |
| 48 | |
| 49 if (dispatcher_->IsExtensionActive(kWebStoreAppId)) { | 40 if (dispatcher_->IsExtensionActive(kWebStoreAppId)) { |
| 50 if (error) | 41 if (error) |
| 51 *error = errors::kCannotScriptGallery; | 42 *error = errors::kCannotScriptGallery; |
| 52 return false; | 43 return false; |
| 53 } | 44 } |
| 54 | 45 |
| 55 return true; | 46 return true; |
| 56 } | 47 } |
| 57 | 48 |
| 58 } // namespace extensions | 49 } // namespace extensions |
| OLD | NEW |