| 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_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/browser.h" | 11 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_dialogs.h" |
| 12 #include "chrome/browser/ui/layout_constants.h" | 13 #include "chrome/browser/ui/layout_constants.h" |
| 13 #include "chrome/common/pref_names.h" | 14 #include "chrome/common/pref_names.h" |
| 14 #include "chrome/grit/chromium_strings.h" | 15 #include "chrome/grit/chromium_strings.h" |
| 15 #include "chrome/grit/generated_resources.h" | 16 #include "chrome/grit/generated_resources.h" |
| 16 #include "chrome/grit/locale_settings.h" | 17 #include "chrome/grit/locale_settings.h" |
| 17 #include "chrome/grit/theme_resources.h" | 18 #include "chrome/grit/theme_resources.h" |
| 18 #include "components/strings/grit/components_strings.h" | 19 #include "components/strings/grit/components_strings.h" |
| 19 #include "content/public/browser/notification_service.h" | 20 #include "content/public/browser/notification_service.h" |
| 20 #include "ui/accessibility/ax_node_data.h" | 21 #include "ui/accessibility/ax_node_data.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 45 browser_(browser), | 46 browser_(browser), |
| 46 observer_(this), | 47 observer_(this), |
| 47 help_center_url_(help_center_url) { | 48 help_center_url_(help_center_url) { |
| 48 set_close_on_deactivate(false); | 49 set_close_on_deactivate(false); |
| 49 | 50 |
| 50 // Compensate for built-in vertical padding in the anchor view's image. | 51 // Compensate for built-in vertical padding in the anchor view's image. |
| 51 set_anchor_view_insets(gfx::Insets( | 52 set_anchor_view_insets(gfx::Insets( |
| 52 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); | 53 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); |
| 53 | 54 |
| 54 observer_.Add(EnumerateModulesModel::GetInstance()); | 55 observer_.Add(EnumerateModulesModel::GetInstance()); |
| 56 |
| 57 chrome::RecordDialogCreation(chrome::DialogIdentifier::CONFLICTING_MODULE); |
| 55 } | 58 } |
| 56 | 59 |
| 57 // static | 60 // static |
| 58 void ConflictingModuleView::MaybeShow(Browser* browser, | 61 void ConflictingModuleView::MaybeShow(Browser* browser, |
| 59 views::View* anchor_view) { | 62 views::View* anchor_view) { |
| 60 static bool done_checking = false; | 63 static bool done_checking = false; |
| 61 if (done_checking) | 64 if (done_checking) |
| 62 return; // Only show the bubble once per launch. | 65 return; // Only show the bubble once per launch. |
| 63 | 66 |
| 64 auto* model = EnumerateModulesModel::GetInstance(); | 67 auto* model = EnumerateModulesModel::GetInstance(); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 162 |
| 160 void ConflictingModuleView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 163 void ConflictingModuleView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 161 node_data->role = ui::AX_ROLE_ALERT_DIALOG; | 164 node_data->role = ui::AX_ROLE_ALERT_DIALOG; |
| 162 } | 165 } |
| 163 | 166 |
| 164 void ConflictingModuleView::OnConflictsAcknowledged() { | 167 void ConflictingModuleView::OnConflictsAcknowledged() { |
| 165 EnumerateModulesModel* model = EnumerateModulesModel::GetInstance(); | 168 EnumerateModulesModel* model = EnumerateModulesModel::GetInstance(); |
| 166 if (!model->ShouldShowConflictWarning()) | 169 if (!model->ShouldShowConflictWarning()) |
| 167 GetWidget()->Close(); | 170 GetWidget()->Close(); |
| 168 } | 171 } |
| OLD | NEW |