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

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

Issue 226023003: Create CrxInstaller directly in WebstoreInstaller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android compilation fix (again). Created 6 years, 8 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 <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 if (state == extensions::BLACKLISTED_SECURITY_VULNERABILITY || 496 if (state == extensions::BLACKLISTED_SECURITY_VULNERABILITY ||
497 state == extensions::BLACKLISTED_POTENTIALLY_UNWANTED || 497 state == extensions::BLACKLISTED_POTENTIALLY_UNWANTED ||
498 state == extensions::BLACKLISTED_CWS_POLICY_VIOLATION) 498 state == extensions::BLACKLISTED_CWS_POLICY_VIOLATION)
499 greylist_.Insert(*it); 499 greylist_.Insert(*it);
500 } 500 }
501 } 501 }
502 502
503 bool ExtensionService::UpdateExtension(const std::string& id, 503 bool ExtensionService::UpdateExtension(const std::string& id,
504 const base::FilePath& extension_path, 504 const base::FilePath& extension_path,
505 bool file_ownership_passed, 505 bool file_ownership_passed,
506 const GURL& download_url,
507 CrxInstaller** out_crx_installer) { 506 CrxInstaller** out_crx_installer) {
508 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 507 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
509 if (browser_terminating_) { 508 if (browser_terminating_) {
510 LOG(WARNING) << "Skipping UpdateExtension due to browser shutdown"; 509 LOG(WARNING) << "Skipping UpdateExtension due to browser shutdown";
511 // Leak the temp file at extension_path. We don't want to add to the disk 510 // Leak the temp file at extension_path. We don't want to add to the disk
512 // I/O burden at shutdown, we can't rely on the I/O completing anyway, and 511 // I/O burden at shutdown, we can't rely on the I/O completing anyway, and
513 // the file is in the OS temp directory which should be cleaned up for us. 512 // the file is in the OS temp directory which should be cleaned up for us.
514 return false; 513 return false;
515 } 514 }
516 515
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
576 575
577 if (extension && extension->was_installed_by_oem()) 576 if (extension && extension->was_installed_by_oem())
578 creation_flags |= Extension::WAS_INSTALLED_BY_OEM; 577 creation_flags |= Extension::WAS_INSTALLED_BY_OEM;
579 578
580 if (extension && extension->is_ephemeral()) 579 if (extension && extension->is_ephemeral())
581 creation_flags |= Extension::IS_EPHEMERAL; 580 creation_flags |= Extension::IS_EPHEMERAL;
582 581
583 installer->set_creation_flags(creation_flags); 582 installer->set_creation_flags(creation_flags);
584 583
585 installer->set_delete_source(file_ownership_passed); 584 installer->set_delete_source(file_ownership_passed);
586 installer->set_download_url(download_url);
587 installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE); 585 installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE);
588 installer->InstallCrx(extension_path); 586 installer->InstallCrx(extension_path);
589 587
590 if (out_crx_installer) 588 if (out_crx_installer)
591 *out_crx_installer = installer.get(); 589 *out_crx_installer = installer.get();
592 590
593 return true; 591 return true;
594 } 592 }
595 593
596 void ExtensionService::ReloadExtension(const std::string extension_id) { 594 void ExtensionService::ReloadExtension(const std::string extension_id) {
(...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 void ExtensionService::UnloadAllExtensionsInternal() { 2443 void ExtensionService::UnloadAllExtensionsInternal() {
2446 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); 2444 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions();
2447 2445
2448 registry_->ClearAll(); 2446 registry_->ClearAll();
2449 system_->runtime_data()->ClearAll(); 2447 system_->runtime_data()->ClearAll();
2450 2448
2451 // TODO(erikkay) should there be a notification for this? We can't use 2449 // TODO(erikkay) should there be a notification for this? We can't use
2452 // EXTENSION_UNLOADED since that implies that the extension has been disabled 2450 // EXTENSION_UNLOADED since that implies that the extension has been disabled
2453 // or uninstalled. 2451 // or uninstalled.
2454 } 2452 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/extensions/extension_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698