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 "chrome/common/extensions/extension_constants.h" | 7 #include "chrome/common/extensions/extension_constants.h" |
| 8 #include "chrome/renderer/searchbox/search_bouncer.h" |
8 #include "extensions/common/constants.h" | 9 #include "extensions/common/constants.h" |
9 #include "extensions/common/extensions_client.h" | 10 #include "extensions/common/extensions_client.h" |
10 #include "extensions/common/manifest_constants.h" | 11 #include "extensions/common/manifest_constants.h" |
11 #include "extensions/common/switches.h" | 12 #include "extensions/common/switches.h" |
12 #include "extensions/renderer/dispatcher.h" | 13 #include "extensions/renderer/dispatcher.h" |
13 | 14 |
14 namespace extensions { | 15 namespace extensions { |
15 | 16 |
16 namespace errors = manifest_errors; | 17 namespace errors = manifest_errors; |
17 | 18 |
(...skipping 12 matching lines...) Expand all Loading... |
30 std::string* error) { | 31 std::string* error) { |
31 if (PermissionsData::CanExecuteScriptEverywhere(extension)) | 32 if (PermissionsData::CanExecuteScriptEverywhere(extension)) |
32 return true; | 33 return true; |
33 | 34 |
34 if (dispatcher_->IsExtensionActive(kWebStoreAppId)) { | 35 if (dispatcher_->IsExtensionActive(kWebStoreAppId)) { |
35 if (error) | 36 if (error) |
36 *error = errors::kCannotScriptGallery; | 37 *error = errors::kCannotScriptGallery; |
37 return false; | 38 return false; |
38 } | 39 } |
39 | 40 |
| 41 if (SearchBouncer::GetInstance()->IsNewTabPage(document_url)) { |
| 42 if (error) |
| 43 *error = errors::kCannotScriptNtp; |
| 44 return false; |
| 45 } |
| 46 |
40 return true; | 47 return true; |
41 } | 48 } |
42 | 49 |
43 } // namespace extensions | 50 } // namespace extensions |
OLD | NEW |