Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 2144313002: Plumbing for login apps device policy to extensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 // TODO(jstritar): We may be able to get rid of this branch by overriding the 1484 // TODO(jstritar): We may be able to get rid of this branch by overriding the
1485 // default extension state to DISABLED when the --disable-extensions flag 1485 // default extension state to DISABLED when the --disable-extensions flag
1486 // is set (http://crbug.com/29067). 1486 // is set (http://crbug.com/29067).
1487 if (!extensions_enabled() && !extension->is_theme() && 1487 if (!extensions_enabled() && !extension->is_theme() &&
1488 extension->location() != Manifest::COMPONENT && 1488 extension->location() != Manifest::COMPONENT &&
1489 !Manifest::IsExternalLocation(extension->location()) && 1489 !Manifest::IsExternalLocation(extension->location()) &&
1490 disable_flag_exempted_extensions_.count(extension->id()) == 0) { 1490 disable_flag_exempted_extensions_.count(extension->id()) == 0) {
1491 return; 1491 return;
1492 } 1492 }
1493 1493
1494 DVLOG(1) << "AddExtension " << extension->name() << ", " << extension->id();
emaxx 2017/02/21 19:44:10 nit: Maybe format it differently, so that it doesn
achuithb 2017/02/22 14:39:34 I got rid of this change; it's useful for my debug
1494 bool is_extension_upgrade = false; 1495 bool is_extension_upgrade = false;
1495 bool is_extension_loaded = false; 1496 bool is_extension_loaded = false;
1496 const Extension* old = GetInstalledExtension(extension->id()); 1497 const Extension* old = GetInstalledExtension(extension->id());
1497 if (old) { 1498 if (old) {
1498 is_extension_loaded = true; 1499 is_extension_loaded = true;
1499 int version_compare_result = 1500 int version_compare_result =
1500 extension->version()->CompareTo(*(old->version())); 1501 extension->version()->CompareTo(*(old->version()));
1501 is_extension_upgrade = version_compare_result > 0; 1502 is_extension_upgrade = version_compare_result > 0;
1502 // Other than for unpacked extensions, CrxInstaller should have guaranteed 1503 // Other than for unpacked extensions, CrxInstaller should have guaranteed
1503 // that we aren't downgrading. 1504 // that we aren't downgrading.
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
2520 } 2521 }
2521 2522
2522 void ExtensionService::OnProfileDestructionStarted() { 2523 void ExtensionService::OnProfileDestructionStarted() {
2523 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2524 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2524 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2525 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2525 it != ids_to_unload.end(); 2526 it != ids_to_unload.end();
2526 ++it) { 2527 ++it) {
2527 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2528 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2528 } 2529 }
2529 } 2530 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698