| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/views/conflicting_module_view_win.h" | 5 #include "chrome/browser/ui/views/conflicting_module_view_win.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "chrome/browser/chrome_notification_types.h" | 8 #include "chrome/browser/chrome_notification_types.h" |
| 9 #include "chrome/browser/enumerate_modules_model_win.h" | 9 #include "chrome/browser/enumerate_modules_model_win.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 const GURL& help_center_url) | 43 const GURL& help_center_url) |
| 44 : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), | 44 : BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), |
| 45 browser_(browser), | 45 browser_(browser), |
| 46 help_center_url_(help_center_url) { | 46 help_center_url_(help_center_url) { |
| 47 set_close_on_deactivate(false); | 47 set_close_on_deactivate(false); |
| 48 | 48 |
| 49 // Compensate for built-in vertical padding in the anchor view's image. | 49 // Compensate for built-in vertical padding in the anchor view's image. |
| 50 set_anchor_view_insets(gfx::Insets( | 50 set_anchor_view_insets(gfx::Insets( |
| 51 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); | 51 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); |
| 52 | 52 |
| 53 registrar_.Add(this, chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_BADGE_CHANGE, | 53 registrar_.Add(this, chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_ICON_CHANGE, |
| 54 content::NotificationService::AllSources()); | 54 content::NotificationService::AllSources()); |
| 55 } | 55 } |
| 56 | 56 |
| 57 // static | 57 // static |
| 58 void ConflictingModuleView::MaybeShow(Browser* browser, | 58 void ConflictingModuleView::MaybeShow(Browser* browser, |
| 59 views::View* anchor_view) { | 59 views::View* anchor_view) { |
| 60 static bool done_checking = false; | 60 static bool done_checking = false; |
| 61 if (done_checking) | 61 if (done_checking) |
| 62 return; // Only show the bubble once per launch. | 62 return; // Only show the bubble once per launch. |
| 63 | 63 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 159 |
| 160 void ConflictingModuleView::GetAccessibleState( | 160 void ConflictingModuleView::GetAccessibleState( |
| 161 ui::AXViewState* state) { | 161 ui::AXViewState* state) { |
| 162 state->role = ui::AX_ROLE_ALERT_DIALOG; | 162 state->role = ui::AX_ROLE_ALERT_DIALOG; |
| 163 } | 163 } |
| 164 | 164 |
| 165 void ConflictingModuleView::Observe( | 165 void ConflictingModuleView::Observe( |
| 166 int type, | 166 int type, |
| 167 const content::NotificationSource& source, | 167 const content::NotificationSource& source, |
| 168 const content::NotificationDetails& details) { | 168 const content::NotificationDetails& details) { |
| 169 DCHECK(type == chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_BADGE_CHANGE); | 169 DCHECK(type == chrome::NOTIFICATION_MODULE_INCOMPATIBILITY_ICON_CHANGE); |
| 170 EnumerateModulesModel* model = EnumerateModulesModel::GetInstance(); | 170 EnumerateModulesModel* model = EnumerateModulesModel::GetInstance(); |
| 171 if (!model->ShouldShowConflictWarning()) | 171 if (!model->ShouldShowConflictWarning()) |
| 172 GetWidget()->Close(); | 172 GetWidget()->Close(); |
| 173 } | 173 } |
| OLD | NEW |