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

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: Created 4 years, 5 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 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 // TODO(jstritar): We may be able to get rid of this branch by overriding the 1445 // TODO(jstritar): We may be able to get rid of this branch by overriding the
1446 // default extension state to DISABLED when the --disable-extensions flag 1446 // default extension state to DISABLED when the --disable-extensions flag
1447 // is set (http://crbug.com/29067). 1447 // is set (http://crbug.com/29067).
1448 if (!extensions_enabled() && 1448 if (!extensions_enabled() &&
1449 !extension->is_theme() && 1449 !extension->is_theme() &&
1450 extension->location() != Manifest::COMPONENT && 1450 extension->location() != Manifest::COMPONENT &&
1451 !Manifest::IsExternalLocation(extension->location())) { 1451 !Manifest::IsExternalLocation(extension->location())) {
1452 return; 1452 return;
1453 } 1453 }
1454 1454
1455 VLOG(1) << "AddExtension " << extension->name() << ", " << extension->id();
1455 bool is_extension_upgrade = false; 1456 bool is_extension_upgrade = false;
1456 bool is_extension_loaded = false; 1457 bool is_extension_loaded = false;
1457 const Extension* old = GetInstalledExtension(extension->id()); 1458 const Extension* old = GetInstalledExtension(extension->id());
1458 if (old) { 1459 if (old) {
1459 is_extension_loaded = true; 1460 is_extension_loaded = true;
1460 int version_compare_result = 1461 int version_compare_result =
1461 extension->version()->CompareTo(*(old->version())); 1462 extension->version()->CompareTo(*(old->version()));
1462 is_extension_upgrade = version_compare_result > 0; 1463 is_extension_upgrade = version_compare_result > 0;
1463 // Other than for unpacked extensions, CrxInstaller should have guaranteed 1464 // Other than for unpacked extensions, CrxInstaller should have guaranteed
1464 // that we aren't downgrading. 1465 // that we aren't downgrading.
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
2466 } 2467 }
2467 2468
2468 void ExtensionService::OnProfileDestructionStarted() { 2469 void ExtensionService::OnProfileDestructionStarted() {
2469 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2470 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2470 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2471 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2471 it != ids_to_unload.end(); 2472 it != ids_to_unload.end();
2472 ++it) { 2473 ++it) {
2473 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2474 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2474 } 2475 }
2475 } 2476 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698