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" | 7 #include "base/command_line.h" |
8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
9 #include "chrome/common/extensions/extension_constants.h" | 9 #include "chrome/common/extensions/extension_constants.h" |
10 #include "chrome/common/extensions/extension_manifest_constants.h" | 10 #include "chrome/common/extensions/extension_manifest_constants.h" |
(...skipping 12 matching lines...) Expand all Loading... | |
23 } | 23 } |
24 | 24 |
25 bool RendererPermissionsPolicyDelegate::CanExecuteScriptOnPage( | 25 bool RendererPermissionsPolicyDelegate::CanExecuteScriptOnPage( |
26 const Extension* extension, | 26 const Extension* extension, |
27 const GURL& document_url, | 27 const GURL& document_url, |
28 const GURL& top_document_url, | 28 const GURL& top_document_url, |
29 int tab_id, | 29 int tab_id, |
30 const UserScript* script, | 30 const UserScript* script, |
31 int process_id, | 31 int process_id, |
32 std::string* error) { | 32 std::string* error) { |
33 #if defined(OS_CHROMEOS) | |
34 if (extension->id() == extension_misc::kChromeVoxExtensionId) | |
dmazzoni
2013/09/05 06:13:55
Could we iterate over ExtensionConfig::get()->whit
Matt Perry
2013/09/05 18:54:29
Sounds reasonable.
| |
35 return true; | |
36 #endif | |
37 | |
33 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSigninProcess)) { | 38 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSigninProcess)) { |
34 if (error) | 39 if (error) |
35 *error = errors::kCannotScriptSigninPage; | 40 *error = errors::kCannotScriptSigninPage; |
36 return false; | 41 return false; |
37 } | 42 } |
38 | 43 |
39 if (dispatcher_->IsExtensionActive(extension_misc::kWebStoreAppId)) { | 44 if (dispatcher_->IsExtensionActive(extension_misc::kWebStoreAppId)) { |
40 if (error) | 45 if (error) |
41 *error = errors::kCannotScriptGallery; | 46 *error = errors::kCannotScriptGallery; |
42 return false; | 47 return false; |
43 } | 48 } |
44 | 49 |
45 return true; | 50 return true; |
46 } | 51 } |
47 | 52 |
48 } // namespace extensions | 53 } // namespace extensions |
OLD | NEW |