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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 | 250 |
| 251 // If it is already enabled, do nothing. | 251 // If it is already enabled, do nothing. |
| 252 if (registry->enabled_extensions().Contains(extension_id)) | 252 if (registry->enabled_extensions().Contains(extension_id)) |
| 253 return; | 253 return; |
| 254 | 254 |
| 255 // If the extension is not loaded, it may need to be reloaded. | 255 // If the extension is not loaded, it may need to be reloaded. |
| 256 // Example is a pre-installed extension that was unloaded when a | 256 // Example is a pre-installed extension that was unloaded when a |
| 257 // supervised user flag has been received. | 257 // supervised user flag has been received. |
| 258 if (!extension) { | 258 if (!extension) { |
| 259 service->ReloadExtension(extension_id); | 259 service->ReloadExtension(extension_id); |
| 260 service->EnableExtension(extension_id); | |
|
Marc Treib
2016/06/24 10:58:55
?
I'm pretty sure we don't want to do this.
mamir
2016/06/24 14:43:07
For the record, discussed in patchset 29
| |
| 260 } | 261 } |
| 261 } | 262 } |
| 262 | 263 |
| 263 bool WasInstalledByCustodian(const std::string& extension_id, | 264 bool WasInstalledByCustodian(const std::string& extension_id, |
| 264 content::BrowserContext* context) { | 265 content::BrowserContext* context) { |
| 265 bool installed_by_custodian = false; | 266 bool installed_by_custodian = false; |
| 266 ExtensionPrefs* prefs = ExtensionPrefs::Get(context); | 267 ExtensionPrefs* prefs = ExtensionPrefs::Get(context); |
| 267 prefs->ReadPrefAsBoolean(extension_id, kWasInstalledByCustodianPrefName, | 268 prefs->ReadPrefAsBoolean(extension_id, kWasInstalledByCustodianPrefName, |
| 268 &installed_by_custodian); | 269 &installed_by_custodian); |
| 269 return installed_by_custodian; | 270 return installed_by_custodian; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 base::FieldTrialList::FindFullName( | 440 base::FieldTrialList::FindFullName( |
| 440 kSupervisedUserExtensionPermissionIncreaseFieldTrialName); | 441 kSupervisedUserExtensionPermissionIncreaseFieldTrialName); |
| 441 std::string value = variations::GetVariationParamValue( | 442 std::string value = variations::GetVariationParamValue( |
| 442 kSupervisedUserExtensionPermissionIncreaseFieldTrialName, | 443 kSupervisedUserExtensionPermissionIncreaseFieldTrialName, |
| 443 profile->IsChild() ? "child_account" : "legacy_supervised_user"); | 444 profile->IsChild() ? "child_account" : "legacy_supervised_user"); |
| 444 return value == "true"; | 445 return value == "true"; |
| 445 } | 446 } |
| 446 | 447 |
| 447 } // namespace util | 448 } // namespace util |
| 448 } // namespace extensions | 449 } // namespace extensions |
| OLD | NEW |