| 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 1821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1832 extension_prefs_->SetDelayedInstallInfo(extension, initial_state, | 1832 extension_prefs_->SetDelayedInstallInfo(extension, initial_state, |
| 1833 install_flags, delay_reason, | 1833 install_flags, delay_reason, |
| 1834 page_ordinal, install_parameter); | 1834 page_ordinal, install_parameter); |
| 1835 | 1835 |
| 1836 // Transfer ownership of |extension|. | 1836 // Transfer ownership of |extension|. |
| 1837 delayed_installs_.Insert(extension); | 1837 delayed_installs_.Insert(extension); |
| 1838 | 1838 |
| 1839 if (delay_reason == | 1839 if (delay_reason == |
| 1840 extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE) { | 1840 extensions::ExtensionPrefs::DELAY_REASON_WAIT_FOR_IDLE) { |
| 1841 // Notify observers that app update is available. | 1841 // Notify observers that app update is available. |
| 1842 FOR_EACH_OBSERVER(extensions::UpdateObserver, update_observers_, | 1842 for (auto& observer : update_observers_) |
| 1843 OnAppUpdateAvailable(extension)); | 1843 observer.OnAppUpdateAvailable(extension); |
| 1844 } | 1844 } |
| 1845 return; | 1845 return; |
| 1846 case extensions::InstallGate::ABORT: | 1846 case extensions::InstallGate::ABORT: |
| 1847 // Do nothing to abort the install. One such case is the shared module | 1847 // Do nothing to abort the install. One such case is the shared module |
| 1848 // service gets IMPORT_STATUS_UNRECOVERABLE status for the pending | 1848 // service gets IMPORT_STATUS_UNRECOVERABLE status for the pending |
| 1849 // install. | 1849 // install. |
| 1850 return; | 1850 return; |
| 1851 } | 1851 } |
| 1852 | 1852 |
| 1853 NOTREACHED() << "Unknown action for delayed install: " << action; | 1853 NOTREACHED() << "Unknown action for delayed install: " << action; |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2201 BrowserThread::PostTask( | 2201 BrowserThread::PostTask( |
| 2202 BrowserThread::IO, | 2202 BrowserThread::IO, |
| 2203 FROM_HERE, | 2203 FROM_HERE, |
| 2204 base::Bind(&extensions::InfoMap::UnregisterAllExtensionsInProcess, | 2204 base::Bind(&extensions::InfoMap::UnregisterAllExtensionsInProcess, |
| 2205 system_->info_map(), | 2205 system_->info_map(), |
| 2206 process->GetID())); | 2206 process->GetID())); |
| 2207 break; | 2207 break; |
| 2208 } | 2208 } |
| 2209 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: { | 2209 case chrome::NOTIFICATION_UPGRADE_RECOMMENDED: { |
| 2210 // Notify observers that chrome update is available. | 2210 // Notify observers that chrome update is available. |
| 2211 FOR_EACH_OBSERVER(extensions::UpdateObserver, update_observers_, | 2211 for (auto& observer : update_observers_) |
| 2212 OnChromeUpdateAvailable()); | 2212 observer.OnChromeUpdateAvailable(); |
| 2213 break; | 2213 break; |
| 2214 } | 2214 } |
| 2215 case chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED: { | 2215 case chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED: { |
| 2216 OnProfileDestructionStarted(); | 2216 OnProfileDestructionStarted(); |
| 2217 break; | 2217 break; |
| 2218 } | 2218 } |
| 2219 | 2219 |
| 2220 default: | 2220 default: |
| 2221 NOTREACHED() << "Unexpected notification type."; | 2221 NOTREACHED() << "Unexpected notification type."; |
| 2222 } | 2222 } |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2476 } | 2476 } |
| 2477 | 2477 |
| 2478 void ExtensionService::OnProfileDestructionStarted() { | 2478 void ExtensionService::OnProfileDestructionStarted() { |
| 2479 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); | 2479 ExtensionIdSet ids_to_unload = registry_->enabled_extensions().GetIDs(); |
| 2480 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); | 2480 for (ExtensionIdSet::iterator it = ids_to_unload.begin(); |
| 2481 it != ids_to_unload.end(); | 2481 it != ids_to_unload.end(); |
| 2482 ++it) { | 2482 ++it) { |
| 2483 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); | 2483 UnloadExtension(*it, UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN); |
| 2484 } | 2484 } |
| 2485 } | 2485 } |
| OLD | NEW |