Chromium Code Reviews| 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 ZoomWithoutBubble(const Extension* extension) { | |
|
Ken Rockot(use gerrit already)
2015/10/21 16:53:30
nit: How about "CanZoomWithoutBubble" or "AllowZoo
wjmaclean
2015/10/21 16:59:46
Done.
I like "AllowZoomWithoutBubble()" ... let's
| |
| 202 return FeatureProvider::GetBehaviorFeature( | |
| 203 BehaviorFeature::kZoomWithoutBubble) | |
| 204 ->IsAvailableToExtension(extension) | |
| 205 .is_available(); | |
| 206 } | |
| 207 | |
| 201 bool AllowFileAccess(const std::string& extension_id, | 208 bool AllowFileAccess(const std::string& extension_id, |
| 202 content::BrowserContext* context) { | 209 content::BrowserContext* context) { |
| 203 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 210 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 204 switches::kDisableExtensionsFileAccessCheck) || | 211 switches::kDisableExtensionsFileAccessCheck) || |
| 205 ExtensionPrefs::Get(context)->AllowFileAccess(extension_id); | 212 ExtensionPrefs::Get(context)->AllowFileAccess(extension_id); |
| 206 } | 213 } |
| 207 | 214 |
| 208 void SetAllowFileAccess(const std::string& extension_id, | 215 void SetAllowFileAccess(const std::string& extension_id, |
| 209 content::BrowserContext* context, | 216 content::BrowserContext* context, |
| 210 bool allow) { | 217 bool allow) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 } | 383 } |
| 377 | 384 |
| 378 bool NeedCustodianApprovalForPermissionIncrease() { | 385 bool NeedCustodianApprovalForPermissionIncrease() { |
| 379 const std::string group_name = base::FieldTrialList::FindFullName( | 386 const std::string group_name = base::FieldTrialList::FindFullName( |
| 380 kSupervisedUserExtensionPermissionIncreaseFieldTrialName); | 387 kSupervisedUserExtensionPermissionIncreaseFieldTrialName); |
| 381 return group_name == "NeedCustodianApproval"; | 388 return group_name == "NeedCustodianApproval"; |
| 382 } | 389 } |
| 383 | 390 |
| 384 } // namespace util | 391 } // namespace util |
| 385 } // namespace extensions | 392 } // namespace extensions |
| OLD | NEW |