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 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 if (cmd_line->HasSwitch(switches::kInstallFromWebstore) || | 552 if (cmd_line->HasSwitch(switches::kInstallFromWebstore) || |
| 553 cmd_line->HasSwitch(switches::kLimitedInstallFromWebstore)) { | 553 cmd_line->HasSwitch(switches::kLimitedInstallFromWebstore)) { |
| 554 // The sole purpose of this launch is to install a new extension from CWS | 554 // The sole purpose of this launch is to install a new extension from CWS |
| 555 // and immediately terminate: loading already installed extensions is | 555 // and immediately terminate: loading already installed extensions is |
| 556 // unnecessary and may interfere with the inline install dialog (e.g. if an | 556 // unnecessary and may interfere with the inline install dialog (e.g. if an |
| 557 // extension listens to onStartup and opens a window). | 557 // extension listens to onStartup and opens a window). |
| 558 SetReadyAndNotifyListeners(); | 558 SetReadyAndNotifyListeners(); |
| 559 } else { | 559 } else { |
| 560 // TODO(mek): It might be cleaner to do the FinishDelayedInstallInfo stuff | 560 // TODO(mek): It might be cleaner to do the FinishDelayedInstallInfo stuff |
| 561 // here instead of in installedloader. | 561 // here instead of in installedloader. |
| 562 if (g_browser_process->profile_manager() && | |
| 563 g_browser_process->profile_manager()->will_import()) { | |
| 564 // Do not load any component extensions, since they may conflict with the | |
| 565 // import process. | |
| 566 | 562 |
| 567 extensions::InstalledLoader(this).LoadAllExtensions(); | 563 // LoadAllExtensions() calls OnLoadedInstalledExtensions(). |
| 568 SetReadyAndNotifyListeners(); | 564 component_loader_->LoadAll(); |
| 569 RegisterForImportFinished(); | 565 extensions::InstalledLoader(this).LoadAllExtensions(); |
|
asargent_no_longer_on_chrome
2013/06/19 18:32:23
I think we can get rid of this RegisterForImportFi
elijahtaylor1
2013/06/19 19:04:01
Great suggestion, I saw this notification and wasn
| |
| 570 } else { | 566 SetReadyAndNotifyListeners(); |
| 571 // In this case, LoadAllExtensions() calls OnLoadedInstalledExtensions(). | |
| 572 component_loader_->LoadAll(); | |
| 573 extensions::InstalledLoader(this).LoadAllExtensions(); | |
| 574 SetReadyAndNotifyListeners(); | |
| 575 | 567 |
| 576 // TODO(erikkay) this should probably be deferred to a future point | 568 // TODO(erikkay) this should probably be deferred to a future point |
| 577 // rather than running immediately at startup. | 569 // rather than running immediately at startup. |
| 578 CheckForExternalUpdates(); | 570 CheckForExternalUpdates(); |
| 579 | 571 |
| 580 base::MessageLoop::current()->PostDelayedTask( | 572 base::MessageLoop::current()->PostDelayedTask( |
| 581 FROM_HERE, | 573 FROM_HERE, |
| 582 base::Bind(&ExtensionService::GarbageCollectExtensions, AsWeakPtr()), | 574 base::Bind(&ExtensionService::GarbageCollectExtensions, AsWeakPtr()), |
| 583 base::TimeDelta::FromSeconds(kGarbageCollectStartupDelay)); | 575 base::TimeDelta::FromSeconds(kGarbageCollectStartupDelay)); |
| 584 } | |
| 585 | 576 |
| 586 if (extension_prefs_->NeedsStorageGarbageCollection()) { | 577 if (extension_prefs_->NeedsStorageGarbageCollection()) { |
| 587 GarbageCollectIsolatedStorage(); | 578 GarbageCollectIsolatedStorage(); |
| 588 extension_prefs_->SetNeedsStorageGarbageCollection(false); | 579 extension_prefs_->SetNeedsStorageGarbageCollection(false); |
| 589 } | 580 } |
| 590 } | 581 } |
| 591 } | 582 } |
| 592 | 583 |
| 593 bool ExtensionService::UpdateExtension(const std::string& id, | 584 bool ExtensionService::UpdateExtension(const std::string& id, |
| 594 const base::FilePath& extension_path, | 585 const base::FilePath& extension_path, |
| (...skipping 2320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2915 } | 2906 } |
| 2916 | 2907 |
| 2917 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { | 2908 void ExtensionService::AddUpdateObserver(extensions::UpdateObserver* observer) { |
| 2918 update_observers_.AddObserver(observer); | 2909 update_observers_.AddObserver(observer); |
| 2919 } | 2910 } |
| 2920 | 2911 |
| 2921 void ExtensionService::RemoveUpdateObserver( | 2912 void ExtensionService::RemoveUpdateObserver( |
| 2922 extensions::UpdateObserver* observer) { | 2913 extensions::UpdateObserver* observer) { |
| 2923 update_observers_.RemoveObserver(observer); | 2914 update_observers_.RemoveObserver(observer); |
| 2924 } | 2915 } |
| OLD | NEW |