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

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

Issue 2306143002: Plumbing for login apps device policy to extensions. (Closed)
Patch Set: Mege Created 4 years, 1 month 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 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 // TODO(jstritar): We may be able to get rid of this branch by overriding the 1453 // TODO(jstritar): We may be able to get rid of this branch by overriding the
1454 // default extension state to DISABLED when the --disable-extensions flag 1454 // default extension state to DISABLED when the --disable-extensions flag
1455 // is set (http://crbug.com/29067). 1455 // is set (http://crbug.com/29067).
1456 if (!extensions_enabled() && !extension->is_theme() && 1456 if (!extensions_enabled() && !extension->is_theme() &&
1457 extension->location() != Manifest::COMPONENT && 1457 extension->location() != Manifest::COMPONENT &&
1458 !Manifest::IsExternalLocation(extension->location()) && 1458 !Manifest::IsExternalLocation(extension->location()) &&
1459 disable_flag_exempted_extensions_.count(extension->id()) == 0) { 1459 disable_flag_exempted_extensions_.count(extension->id()) == 0) {
1460 return; 1460 return;
1461 } 1461 }
1462 1462
1463 VLOG(1) << "AddExtension " << extension->name() << ", " << extension->id();
1463 bool is_extension_upgrade = false; 1464 bool is_extension_upgrade = false;
1464 bool is_extension_loaded = false; 1465 bool is_extension_loaded = false;
1465 const Extension* old = GetInstalledExtension(extension->id()); 1466 const Extension* old = GetInstalledExtension(extension->id());
1466 if (old) { 1467 if (old) {
1467 is_extension_loaded = true; 1468 is_extension_loaded = true;
1468 int version_compare_result = 1469 int version_compare_result =
1469 extension->version()->CompareTo(*(old->version())); 1470 extension->version()->CompareTo(*(old->version()));
1470 is_extension_upgrade = version_compare_result > 0; 1471 is_extension_upgrade = version_compare_result > 0;
1471 // Other than for unpacked extensions, CrxInstaller should have guaranteed 1472 // Other than for unpacked extensions, CrxInstaller should have guaranteed
1472 // that we aren't downgrading. 1473 // that we aren't downgrading.
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
2476 } 2477 }
2477 2478
2478 void ExtensionService::OnProfileDestructionStarted() { 2479 void ExtensionService::OnProfileDestructionStarted() {
2479 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); 2480 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs();
2480 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); 2481 for (ExtensionIdSet::iterator it = ids_to_unload.begin();
2481 it != ids_to_unload.end(); 2482 it != ids_to_unload.end();
2482 ++it) { 2483 ++it) {
2483 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); 2484 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN);
2484 } 2485 }
2485 } 2486 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698