| Index: chrome/browser/component_updater/pnacl/pnacl_updater_observer.cc
|
| diff --git a/chrome/browser/component_updater/pnacl/pnacl_profile_observer.cc b/chrome/browser/component_updater/pnacl/pnacl_updater_observer.cc
|
| similarity index 54%
|
| copy from chrome/browser/component_updater/pnacl/pnacl_profile_observer.cc
|
| copy to chrome/browser/component_updater/pnacl/pnacl_updater_observer.cc
|
| index a3f9e34cec11e5aa4a001deabb925e69e2492284..2a3a6fa891914eb5e626177235f414a1f71fce20 100644
|
| --- a/chrome/browser/component_updater/pnacl/pnacl_profile_observer.cc
|
| +++ b/chrome/browser/component_updater/pnacl/pnacl_updater_observer.cc
|
| @@ -2,35 +2,30 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/component_updater/pnacl/pnacl_profile_observer.h"
|
| +#include "chrome/browser/component_updater/pnacl/pnacl_updater_observer.h"
|
|
|
| #include "base/logging.h"
|
| #include "chrome/browser/component_updater/pnacl/pnacl_component_installer.h"
|
| #include "chrome/common/chrome_notification_types.h"
|
| #include "content/public/browser/notification_service.h"
|
|
|
| -PnaclProfileObserver::PnaclProfileObserver(
|
| +PnaclUpdaterObserver::PnaclUpdaterObserver(
|
| PnaclComponentInstaller* installer) : pnacl_installer_(installer) {
|
| - // We only need to observe NOTIFICATION_LOGIN_USER_CHANGED for ChromeOS
|
| - // (and it's only defined for ChromeOS).
|
| -#if defined(OS_CHROMEOS)
|
| registrar_.Add(this,
|
| - chrome::NOTIFICATION_LOGIN_USER_CHANGED,
|
| + chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING,
|
| content::NotificationService::AllSources());
|
| -#endif
|
| }
|
|
|
| -PnaclProfileObserver::~PnaclProfileObserver() { }
|
| +PnaclUpdaterObserver::~PnaclUpdaterObserver() { }
|
|
|
| -void PnaclProfileObserver::Observe(
|
| +void PnaclUpdaterObserver::Observe(
|
| int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| -#if defined(OS_CHROMEOS)
|
| - if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED) {
|
| - pnacl_installer_->ReRegisterPnacl();
|
| + if (type == chrome::NOTIFICATION_COMPONENT_UPDATER_SLEEPING) {
|
| + // If the component updater sleeps before a NotifyInstallSuccess,
|
| + // then requests for installs were likely skipped, or an error occurred.
|
| + pnacl_installer_->NotifyInstallError();
|
| return;
|
| }
|
| - NOTREACHED() << "Unexpected notification observed";
|
| -#endif
|
| }
|
|
|