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/browser/extensions/extension_util.h" | 5 #include "chrome/browser/extensions/extension_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 content::BrowserContext* context) { | 191 content::BrowserContext* context) { |
192 CHECK(extension); | 192 CHECK(extension); |
193 if (extension->is_hosted_app()) | 193 if (extension->is_hosted_app()) |
194 return true; | 194 return true; |
195 // Packaged apps and regular extensions need to be enabled specifically for | 195 // Packaged apps and regular extensions need to be enabled specifically for |
196 // incognito (and split mode should be set). | 196 // incognito (and split mode should be set). |
197 return IncognitoInfo::IsSplitMode(extension) && | 197 return IncognitoInfo::IsSplitMode(extension) && |
198 IsIncognitoEnabled(extension->id(), context); | 198 IsIncognitoEnabled(extension->id(), context); |
199 } | 199 } |
200 | 200 |
201 bool AllowZoomWithoutBubble(const Extension* extension) { | |
202 return FeatureProvider::GetBehaviorFeature( | |
203 BehaviorFeature::kZoomWithoutBubble) | |
204 ->IsAvailableToExtension(extension) | |
205 .is_available(); | |
206 } | |
207 | |
208 bool AllowFileAccess(const std::string& extension_id, | 201 bool AllowFileAccess(const std::string& extension_id, |
209 content::BrowserContext* context) { | 202 content::BrowserContext* context) { |
210 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 203 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
211 switches::kDisableExtensionsFileAccessCheck) || | 204 switches::kDisableExtensionsFileAccessCheck) || |
212 ExtensionPrefs::Get(context)->AllowFileAccess(extension_id); | 205 ExtensionPrefs::Get(context)->AllowFileAccess(extension_id); |
213 } | 206 } |
214 | 207 |
215 void SetAllowFileAccess(const std::string& extension_id, | 208 void SetAllowFileAccess(const std::string& extension_id, |
216 content::BrowserContext* context, | 209 content::BrowserContext* context, |
217 bool allow) { | 210 bool allow) { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 } | 376 } |
384 | 377 |
385 bool NeedCustodianApprovalForPermissionIncrease() { | 378 bool NeedCustodianApprovalForPermissionIncrease() { |
386 const std::string group_name = base::FieldTrialList::FindFullName( | 379 const std::string group_name = base::FieldTrialList::FindFullName( |
387 kSupervisedUserExtensionPermissionIncreaseFieldTrialName); | 380 kSupervisedUserExtensionPermissionIncreaseFieldTrialName); |
388 return group_name == "NeedCustodianApproval"; | 381 return group_name == "NeedCustodianApproval"; |
389 } | 382 } |
390 | 383 |
391 } // namespace util | 384 } // namespace util |
392 } // namespace extensions | 385 } // namespace extensions |
OLD | NEW |