OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_service.h" | 5 #include "chrome/browser/extensions/extension_service.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1454 // TODO(jstritar): We may be able to get rid of this branch by overriding the | 1454 // TODO(jstritar): We may be able to get rid of this branch by overriding the |
1455 // default extension state to DISABLED when the --disable-extensions flag | 1455 // default extension state to DISABLED when the --disable-extensions flag |
1456 // is set (http://crbug.com/29067). | 1456 // is set (http://crbug.com/29067). |
1457 if (!extensions_enabled() && !extension->is_theme() && | 1457 if (!extensions_enabled() && !extension->is_theme() && |
1458 extension->location() != Manifest::COMPONENT && | 1458 extension->location() != Manifest::COMPONENT && |
1459 !Manifest::IsExternalLocation(extension->location()) && | 1459 !Manifest::IsExternalLocation(extension->location()) && |
1460 disable_flag_exempted_extensions_.count(extension->id()) == 0) { | 1460 disable_flag_exempted_extensions_.count(extension->id()) == 0) { |
1461 return; | 1461 return; |
1462 } | 1462 } |
1463 | 1463 |
1464 VLOG(1) << "AddExtension " << extension->name() << ", " << extension->id(); | |
asargent_no_longer_on_chrome
2016/11/14 21:30:25
nit: should this logging be checked in?
https://c
achuithb
2016/11/14 21:59:00
This is the only place where we log all the extens
Denis Kuznetsov (DE-MUC)
2016/11/17 18:13:01
Done.
| |
1464 bool is_extension_upgrade = false; | 1465 bool is_extension_upgrade = false; |
1465 bool is_extension_loaded = false; | 1466 bool is_extension_loaded = false; |
1466 const Extension* old = GetInstalledExtension(extension->id()); | 1467 const Extension* old = GetInstalledExtension(extension->id()); |
1467 if (old) { | 1468 if (old) { |
1468 is_extension_loaded = true; | 1469 is_extension_loaded = true; |
1469 int version_compare_result = | 1470 int version_compare_result = |
1470 extension->version()->CompareTo(*(old->version())); | 1471 extension->version()->CompareTo(*(old->version())); |
1471 is_extension_upgrade = version_compare_result > 0; | 1472 is_extension_upgrade = version_compare_result > 0; |
1472 // Other than for unpacked extensions, CrxInstaller should have guaranteed | 1473 // Other than for unpacked extensions, CrxInstaller should have guaranteed |
1473 // that we aren't downgrading. | 1474 // that we aren't downgrading. |
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2477 } | 2478 } |
2478 | 2479 |
2479 void ExtensionService::OnProfileDestructionStarted() { | 2480 void ExtensionService::OnProfileDestructionStarted() { |
2480 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2481 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
2481 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2482 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
2482 it != ids_to_unload.end(); | 2483 it != ids_to_unload.end(); |
2483 ++it) { | 2484 ++it) { |
2484 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2485 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
2485 } | 2486 } |
2486 } | 2487 } |
OLD | NEW |