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

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

Issue 680213003: Cleanup: Remove most enable_extensions logic in chrome/ extensions code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « chrome/renderer/extensions/extension_frame_helper.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 21 matching lines...) Expand all
32 int tab_id, 32 int tab_id,
33 int process_id, 33 int process_id,
34 std::string* error) { 34 std::string* error) {
35 const ExtensionsClient::ScriptingWhitelist& whitelist = 35 const ExtensionsClient::ScriptingWhitelist& whitelist =
36 ExtensionsClient::Get()->GetScriptingWhitelist(); 36 ExtensionsClient::Get()->GetScriptingWhitelist();
37 if (std::find(whitelist.begin(), whitelist.end(), extension->id()) != 37 if (std::find(whitelist.begin(), whitelist.end(), extension->id()) !=
38 whitelist.end()) { 38 whitelist.end()) {
39 return true; 39 return true;
40 } 40 }
41 41
42 CommandLine* command_line = CommandLine::ForCurrentProcess(); 42 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
43 if (command_line->HasSwitch(::switches::kSigninProcess)) { 43 if (command_line->HasSwitch(::switches::kSigninProcess)) {
44 if (error) 44 if (error)
45 *error = errors::kCannotScriptSigninPage; 45 *error = errors::kCannotScriptSigninPage;
46 return false; 46 return false;
47 } 47 }
48 48
49 // TODO(thestig): Remove scaffolding once this file no longer builds with 49 if (dispatcher_->IsExtensionActive(kWebStoreAppId)) {
50 // extensions disabled.
51 #if defined(ENABLE_EXTENSIONS)
52 if (dispatcher_->IsExtensionActive(extensions::kWebStoreAppId)) {
53 if (error) 50 if (error)
54 *error = errors::kCannotScriptGallery; 51 *error = errors::kCannotScriptGallery;
55 return false; 52 return false;
56 } 53 }
57 #endif
58 54
59 return true; 55 return true;
60 } 56 }
61 57
62 } // namespace extensions 58 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/extension_frame_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698