Chromium Code Reviews| 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(); |