Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: chrome/renderer/extensions/renderer_permissions_policy_delegate.cc

Issue 2978953002: [Extensions] Don't allow content scripts on the New Tab Page (Closed)
Patch Set: Remove logging! Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698