| 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 1309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 | 1320 |
| 1321 // Some extensions will autoupdate themselves externally from Chrome. These | 1321 // Some extensions will autoupdate themselves externally from Chrome. These |
| 1322 // are typically part of some larger client application package. To support | 1322 // are typically part of some larger client application package. To support |
| 1323 // these, the extension will register its location in the preferences file | 1323 // these, the extension will register its location in the preferences file |
| 1324 // (and also, on Windows, in the registry) and this code will periodically | 1324 // (and also, on Windows, in the registry) and this code will periodically |
| 1325 // check that location for a .crx file, which it will then install locally if | 1325 // check that location for a .crx file, which it will then install locally if |
| 1326 // a new version is available. | 1326 // a new version is available. |
| 1327 // Errors are reported through ExtensionErrorReporter. Success is not | 1327 // Errors are reported through ExtensionErrorReporter. Success is not |
| 1328 // reported. | 1328 // reported. |
| 1329 void ExtensionService::CheckForExternalUpdates() { | 1329 void ExtensionService::CheckForExternalUpdates() { |
| 1330 if (external_updates_disabled_for_test_) |
| 1331 return; |
| 1332 |
| 1330 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 1333 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 1331 TRACE_EVENT0("browser,startup", "ExtensionService::CheckForExternalUpdates"); | 1334 TRACE_EVENT0("browser,startup", "ExtensionService::CheckForExternalUpdates"); |
| 1332 SCOPED_UMA_HISTOGRAM_TIMER("Extensions.CheckForExternalUpdatesTime"); | 1335 SCOPED_UMA_HISTOGRAM_TIMER("Extensions.CheckForExternalUpdatesTime"); |
| 1333 | 1336 |
| 1334 // Note that this installation is intentionally silent (since it didn't | 1337 // Note that this installation is intentionally silent (since it didn't |
| 1335 // go through the front-end). Extensions that are registered in this | 1338 // go through the front-end). Extensions that are registered in this |
| 1336 // way are effectively considered 'pre-bundled', and so implicitly | 1339 // way are effectively considered 'pre-bundled', and so implicitly |
| 1337 // trusted. In general, if something has HKLM or filesystem access, | 1340 // trusted. In general, if something has HKLM or filesystem access, |
| 1338 // they could install an extension manually themselves anyway. | 1341 // they could install an extension manually themselves anyway. |
| 1339 | 1342 |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2556 } | 2559 } |
| 2557 | 2560 |
| 2558 void ExtensionService::OnProfileDestructionStarted() { | 2561 void ExtensionService::OnProfileDestructionStarted() { |
| 2559 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2562 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2560 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2563 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2561 it != ids_to_unload.end(); | 2564 it != ids_to_unload.end(); |
| 2562 ++it) { | 2565 ++it) { |
| 2563 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2566 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2564 } | 2567 } |
| 2565 } | 2568 } |
| OLD | NEW |