| Index: chrome/browser/extensions/extension_process_manager.cc
|
| diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc
|
| index bfb1b4b3bccbe0bde8c7cc1f1dbfcd1a3307b20c..03f4dfc8675c270612220e86651e3cb28a07eb06 100644
|
| --- a/chrome/browser/extensions/extension_process_manager.cc
|
| +++ b/chrome/browser/extensions/extension_process_manager.cc
|
| @@ -150,8 +150,12 @@ ExtensionProcessManager::ExtensionProcessManager(Profile* profile)
|
| content::Source<Profile>(profile));
|
| registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_CONNECTED,
|
| content::NotificationService::AllSources());
|
| - registrar_.Add(this, content::NOTIFICATION_APP_TERMINATING,
|
| - content::NotificationService::AllSources());
|
| + registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
|
| + content::Source<Profile>(profile));
|
| + if (profile->IsOffTheRecord()) {
|
| + registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
|
| + content::Source<Profile>(original_profile));
|
| + }
|
| registrar_.Add(this, content::NOTIFICATION_DEVTOOLS_WINDOW_OPENING,
|
| content::Source<content::BrowserContext>(profile));
|
| registrar_.Add(this, content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING,
|
| @@ -587,7 +591,7 @@ void ExtensionProcessManager::Observe(
|
| break;
|
| }
|
|
|
| - case content::NOTIFICATION_APP_TERMINATING: {
|
| + case chrome::NOTIFICATION_PROFILE_DESTROYED: {
|
| // Close background hosts when the last browser is closed so that they
|
| // have time to shutdown various objects on different threads. Our
|
| // destructor is called too late in the shutdown sequence.
|
|
|