| Index: chrome/browser/ui/toolbar/app_menu_icon_controller.cc
|
| diff --git a/chrome/browser/ui/toolbar/app_menu_icon_controller.cc b/chrome/browser/ui/toolbar/app_menu_icon_controller.cc
|
| index 2d67da24e355e5f67395964cead480273f40ff08..79b6acb49e7ffd3862077472f3e95a422b4c51c1 100644
|
| --- a/chrome/browser/ui/toolbar/app_menu_icon_controller.cc
|
| +++ b/chrome/browser/ui/toolbar/app_menu_icon_controller.cc
|
| @@ -71,11 +71,11 @@ AppMenuIconController::AppMenuIconController(Profile* profile,
|
| DCHECK(profile_);
|
| DCHECK(delegate_);
|
|
|
| - registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
|
| - content::NotificationService::AllSources());
|
| registrar_.Add(this, chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED,
|
| content::Source<Profile>(profile_));
|
|
|
| + UpgradeDetector::GetInstance()->AddObserver(this);
|
| +
|
| #if defined(OS_WIN)
|
| auto* modules = EnumerateModulesModel::GetInstance();
|
| modules->AddObserver(this);
|
| @@ -84,6 +84,8 @@ AppMenuIconController::AppMenuIconController(Profile* profile,
|
| }
|
|
|
| AppMenuIconController::~AppMenuIconController() {
|
| + UpgradeDetector::GetInstance()->RemoveObserver(this);
|
| +
|
| #if defined(OS_WIN)
|
| EnumerateModulesModel::GetInstance()->RemoveObserver(this);
|
| #endif
|
| @@ -131,5 +133,10 @@ void AppMenuIconController::Observe(
|
| int type,
|
| const content::NotificationSource& source,
|
| const content::NotificationDetails& details) {
|
| + DCHECK_EQ(chrome::NOTIFICATION_GLOBAL_ERRORS_CHANGED, type);
|
| + UpdateDelegate();
|
| +}
|
| +
|
| +void AppMenuIconController::OnUpgradeRecommended() {
|
| UpdateDelegate();
|
| }
|
|
|