Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Unified Diff: chrome/browser/ui/toolbar/app_menu_icon_controller.cc

Issue 2037883004: [Win] Add reporting of total number of modules loaded in browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/toolbar/app_menu_icon_controller.h ('k') | chrome/browser/ui/toolbar/app_menu_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a02056729d5277fa06e43e8689d1d27443371938..6ebcd7f0c9dfd3e1a537095fcd59c201bb2e65a7 100644
--- a/chrome/browser/ui/toolbar/app_menu_icon_controller.cc
+++ b/chrome/browser/ui/toolbar/app_menu_icon_controller.cc
@@ -66,9 +66,7 @@ bool ShouldShowUpgradeRecommended() {
// Returns true if we should show the warning for incompatible software.
bool ShouldShowIncompatibilityWarning() {
#if defined(OS_WIN)
- EnumerateModulesModel* loaded_modules = EnumerateModulesModel::GetInstance();
- loaded_modules->MaybePostScanningTask();
- return loaded_modules->ShouldShowConflictWarning();
+ return EnumerateModulesModel::GetInstance()->ShouldShowConflictWarning();
#else
return false;
#endif
@@ -88,12 +86,17 @@ AppMenuIconController::AppMenuIconController(Profile* profile,
content::Source<Profile>(profile_));
#if defined(OS_WIN)
- registrar_.Add(this, chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_ICON_CHANGE,
- content::NotificationService::AllSources());
+ auto* modules = EnumerateModulesModel::GetInstance();
+ modules->AddObserver(this);
+ modules->MaybePostScanningTask();
#endif
}
-AppMenuIconController::~AppMenuIconController() {}
+AppMenuIconController::~AppMenuIconController() {
+#if defined(OS_WIN)
+ EnumerateModulesModel::GetInstance()->RemoveObserver(this);
+#endif
+}
void AppMenuIconController::UpdateDelegate() {
if (ShouldShowUpgradeRecommended()) {
@@ -123,6 +126,17 @@ void AppMenuIconController::UpdateDelegate() {
delegate_->UpdateSeverity(IconType::NONE,
AppMenuIconPainter::SEVERITY_NONE, true);
}
+
+#if defined(OS_WIN)
+void AppMenuIconController::OnScanCompleted() {
+ UpdateDelegate();
+}
+
+void AppMenuIconController::OnConflictsAcknowledged() {
+ UpdateDelegate();
+}
+#endif
+
void AppMenuIconController::Observe(
int type,
const content::NotificationSource& source,
« no previous file with comments | « chrome/browser/ui/toolbar/app_menu_icon_controller.h ('k') | chrome/browser/ui/toolbar/app_menu_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698