Chromium Code Reviews| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 537 if (state == extensions::BLACKLISTED_SECURITY_VULNERABILITY || | 537 if (state == extensions::BLACKLISTED_SECURITY_VULNERABILITY || |
| 538 state == extensions::BLACKLISTED_POTENTIALLY_UNWANTED || | 538 state == extensions::BLACKLISTED_POTENTIALLY_UNWANTED || |
| 539 state == extensions::BLACKLISTED_CWS_POLICY_VIOLATION) | 539 state == extensions::BLACKLISTED_CWS_POLICY_VIOLATION) |
| 540 greylist_.Insert(*it); | 540 greylist_.Insert(*it); |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 | 543 |
| 544 bool ExtensionService::UpdateExtension(const std::string& id, | 544 bool ExtensionService::UpdateExtension(const std::string& id, |
| 545 const base::FilePath& extension_path, | 545 const base::FilePath& extension_path, |
| 546 bool file_ownership_passed, | 546 bool file_ownership_passed, |
| 547 const GURL& download_url, | 547 const GURL& download_url, |
|
asanka
2014/04/07 15:26:00
Nit: download_url is unused.
| |
| 548 CrxInstaller** out_crx_installer) { | 548 CrxInstaller** out_crx_installer) { |
| 549 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 549 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 550 if (browser_terminating_) { | 550 if (browser_terminating_) { |
| 551 LOG(WARNING) << "Skipping UpdateExtension due to browser shutdown"; | 551 LOG(WARNING) << "Skipping UpdateExtension due to browser shutdown"; |
| 552 // Leak the temp file at extension_path. We don't want to add to the disk | 552 // Leak the temp file at extension_path. We don't want to add to the disk |
| 553 // I/O burden at shutdown, we can't rely on the I/O completing anyway, and | 553 // I/O burden at shutdown, we can't rely on the I/O completing anyway, and |
| 554 // the file is in the OS temp directory which should be cleaned up for us. | 554 // the file is in the OS temp directory which should be cleaned up for us. |
| 555 return false; | 555 return false; |
| 556 } | 556 } |
| 557 | 557 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 617 | 617 |
| 618 if (extension && extension->was_installed_by_oem()) | 618 if (extension && extension->was_installed_by_oem()) |
| 619 creation_flags |= Extension::WAS_INSTALLED_BY_OEM; | 619 creation_flags |= Extension::WAS_INSTALLED_BY_OEM; |
| 620 | 620 |
| 621 if (extension && extension->is_ephemeral()) | 621 if (extension && extension->is_ephemeral()) |
| 622 creation_flags |= Extension::IS_EPHEMERAL; | 622 creation_flags |= Extension::IS_EPHEMERAL; |
| 623 | 623 |
| 624 installer->set_creation_flags(creation_flags); | 624 installer->set_creation_flags(creation_flags); |
| 625 | 625 |
| 626 installer->set_delete_source(file_ownership_passed); | 626 installer->set_delete_source(file_ownership_passed); |
| 627 installer->set_download_url(download_url); | |
|
not at google - send to devlin
2014/04/04 15:39:30
why not setting download ID? was this always unnec
msimonides
2014/04/07 07:23:38
The download ID is not available here. But most im
not at google - send to devlin
2014/04/07 16:51:40
I see. It's weird that the download ID is a concer
| |
| 628 installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE); | 627 installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE); |
| 629 installer->InstallCrx(extension_path); | 628 installer->InstallCrx(extension_path); |
| 630 | 629 |
| 631 if (out_crx_installer) | 630 if (out_crx_installer) |
| 632 *out_crx_installer = installer.get(); | 631 *out_crx_installer = installer.get(); |
| 633 | 632 |
| 634 return true; | 633 return true; |
| 635 } | 634 } |
| 636 | 635 |
| 637 void ExtensionService::ReloadExtension(const std::string extension_id) { | 636 void ExtensionService::ReloadExtension(const std::string extension_id) { |
| (...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2656 void ExtensionService::UnloadAllExtensionsInternal() { | 2655 void ExtensionService::UnloadAllExtensionsInternal() { |
| 2657 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); | 2656 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); |
| 2658 | 2657 |
| 2659 registry_->ClearAll(); | 2658 registry_->ClearAll(); |
| 2660 system_->runtime_data()->ClearAll(); | 2659 system_->runtime_data()->ClearAll(); |
| 2661 | 2660 |
| 2662 // TODO(erikkay) should there be a notification for this? We can't use | 2661 // TODO(erikkay) should there be a notification for this? We can't use |
| 2663 // EXTENSION_UNLOADED since that implies that the extension has been disabled | 2662 // EXTENSION_UNLOADED since that implies that the extension has been disabled |
| 2664 // or uninstalled. | 2663 // or uninstalled. |
| 2665 } | 2664 } |
| OLD | NEW |