| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 } | 192 } |
| 193 | 193 |
| 194 void SetWasInstalledByCustodian(const std::string& extension_id, | 194 void SetWasInstalledByCustodian(const std::string& extension_id, |
| 195 content::BrowserContext* context, | 195 content::BrowserContext* context, |
| 196 bool installed_by_custodian) { | 196 bool installed_by_custodian) { |
| 197 if (installed_by_custodian == WasInstalledByCustodian(extension_id, context)) | 197 if (installed_by_custodian == WasInstalledByCustodian(extension_id, context)) |
| 198 return; | 198 return; |
| 199 | 199 |
| 200 ExtensionPrefs::Get(context)->UpdateExtensionPref( | 200 ExtensionPrefs::Get(context)->UpdateExtensionPref( |
| 201 extension_id, kWasInstalledByCustodianPrefName, | 201 extension_id, kWasInstalledByCustodianPrefName, |
| 202 installed_by_custodian ? new base::FundamentalValue(true) : nullptr); | 202 installed_by_custodian ? new base::Value(true) : nullptr); |
| 203 ExtensionService* service = | 203 ExtensionService* service = |
| 204 ExtensionSystem::Get(context)->extension_service(); | 204 ExtensionSystem::Get(context)->extension_service(); |
| 205 | 205 |
| 206 if (!installed_by_custodian) { | 206 if (!installed_by_custodian) { |
| 207 // If installed_by_custodian changes to false, the extension may need to | 207 // If installed_by_custodian changes to false, the extension may need to |
| 208 // be unloaded now. | 208 // be unloaded now. |
| 209 service->ReloadExtension(extension_id); | 209 service->ReloadExtension(extension_id); |
| 210 return; | 210 return; |
| 211 } | 211 } |
| 212 | 212 |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 #endif | 347 #endif |
| 348 } | 348 } |
| 349 | 349 |
| 350 bool IsExtensionSupervised(const Extension* extension, Profile* profile) { | 350 bool IsExtensionSupervised(const Extension* extension, Profile* profile) { |
| 351 return WasInstalledByCustodian(extension->id(), profile) && | 351 return WasInstalledByCustodian(extension->id(), profile) && |
| 352 profile->IsSupervised(); | 352 profile->IsSupervised(); |
| 353 } | 353 } |
| 354 | 354 |
| 355 } // namespace util | 355 } // namespace util |
| 356 } // namespace extensions | 356 } // namespace extensions |
| OLD | NEW |