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

Unified Diff: chrome/browser/ui/views/conflicting_module_view_win.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: Small fixes. 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
Index: chrome/browser/ui/views/conflicting_module_view_win.cc
diff --git a/chrome/browser/ui/views/conflicting_module_view_win.cc b/chrome/browser/ui/views/conflicting_module_view_win.cc
index 7f428d03b19f2434dc637fe427c04d2ff1defbb8..f5913e1d0984683d13c1d2a1405fad12d6299085 100644
--- a/chrome/browser/ui/views/conflicting_module_view_win.cc
+++ b/chrome/browser/ui/views/conflicting_module_view_win.cc
@@ -9,7 +9,6 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/layout_constants.h"
-#include "chrome/browser/win/enumerate_modules_model.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
@@ -51,8 +50,8 @@ ConflictingModuleView::ConflictingModuleView(views::View* anchor_view,
set_anchor_view_insets(gfx::Insets(
GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0));
- registrar_.Add(this, chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_ICON_CHANGE,
- content::NotificationService::AllSources());
+ // Register for notifications about conflicting modules.
+ EnumerateModulesModel::GetInstance()->AddObserver(this);
Peter Kasting 2016/08/05 00:10:08 Nit: See earlier comment about whether using a Sco
chrisha 2016/08/12 19:04:40 Done.
}
// static
@@ -63,7 +62,7 @@ void ConflictingModuleView::MaybeShow(Browser* browser,
return; // Only show the bubble once per launch.
EnumerateModulesModel* model = EnumerateModulesModel::GetInstance();
- GURL url = model->GetFirstNotableConflict();
+ GURL url = model->GetConflictUrl();
if (!url.is_valid()) {
Peter Kasting 2016/08/05 00:10:08 Nit: See earlier comment about whether this is nec
chrisha 2016/08/12 19:04:40 Acknowledged.
done_checking = true;
return;
@@ -97,6 +96,7 @@ void ConflictingModuleView::MaybeShow(Browser* browser,
// ConflictingModuleView - private.
ConflictingModuleView::~ConflictingModuleView() {
+ EnumerateModulesModel::GetInstance()->RemoveObserver(this);
}
void ConflictingModuleView::ShowBubble() {
@@ -163,11 +163,7 @@ void ConflictingModuleView::GetAccessibleState(
state->role = ui::AX_ROLE_ALERT_DIALOG;
}
-void ConflictingModuleView::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK_EQ(chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_ICON_CHANGE, type);
+void ConflictingModuleView::OnConflictsAcknowledged() {
EnumerateModulesModel* model = EnumerateModulesModel::GetInstance();
if (!model->ShouldShowConflictWarning())
GetWidget()->Close();

Powered by Google App Engine
This is Rietveld 408576698