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" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 void ConflictingModuleView::ShowBubble() { | 105 void ConflictingModuleView::ShowBubble() { |
106 GetWidget()->Show(); | 106 GetWidget()->Show(); |
107 | 107 |
108 IntegerPrefMember bubble_shown; | 108 IntegerPrefMember bubble_shown; |
109 bubble_shown.Init( | 109 bubble_shown.Init( |
110 prefs::kModuleConflictBubbleShown, | 110 prefs::kModuleConflictBubbleShown, |
111 browser_->profile()->GetPrefs()); | 111 browser_->profile()->GetPrefs()); |
112 bubble_shown.SetValue(bubble_shown.GetValue() + 1); | 112 bubble_shown.SetValue(bubble_shown.GetValue() + 1); |
113 } | 113 } |
114 | 114 |
| 115 ui::AXRole ConflictingModuleView::GetAccessibleWindowRole() const { |
| 116 return ui::AX_ROLE_ALERT_DIALOG; |
| 117 } |
| 118 |
115 void ConflictingModuleView::OnWidgetClosing(views::Widget* widget) { | 119 void ConflictingModuleView::OnWidgetClosing(views::Widget* widget) { |
116 views::BubbleDialogDelegateView::OnWidgetClosing(widget); | 120 views::BubbleDialogDelegateView::OnWidgetClosing(widget); |
117 base::RecordAction( | 121 base::RecordAction( |
118 UserMetricsAction("ConflictingModuleNotificationDismissed")); | 122 UserMetricsAction("ConflictingModuleNotificationDismissed")); |
119 } | 123 } |
120 | 124 |
121 bool ConflictingModuleView::Accept() { | 125 bool ConflictingModuleView::Accept() { |
122 browser_->OpenURL( | 126 browser_->OpenURL( |
123 content::OpenURLParams(help_center_url_, content::Referrer(), | 127 content::OpenURLParams(help_center_url_, content::Referrer(), |
124 WindowOpenDisposition::NEW_FOREGROUND_TAB, | 128 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
(...skipping 30 matching lines...) Expand all Loading... |
155 IDS_CONFLICTING_MODULE_BUBBLE_WIDTH_CHARS)); | 159 IDS_CONFLICTING_MODULE_BUBBLE_WIDTH_CHARS)); |
156 AddChildView(explanation); | 160 AddChildView(explanation); |
157 | 161 |
158 base::RecordAction(UserMetricsAction("ConflictingModuleNotificationShown")); | 162 base::RecordAction(UserMetricsAction("ConflictingModuleNotificationShown")); |
159 | 163 |
160 UMA_HISTOGRAM_ENUMERATION("ConflictingModule.UserSelection", | 164 UMA_HISTOGRAM_ENUMERATION("ConflictingModule.UserSelection", |
161 EnumerateModulesModel::ACTION_BUBBLE_SHOWN, | 165 EnumerateModulesModel::ACTION_BUBBLE_SHOWN, |
162 EnumerateModulesModel::ACTION_BOUNDARY); | 166 EnumerateModulesModel::ACTION_BOUNDARY); |
163 } | 167 } |
164 | 168 |
165 void ConflictingModuleView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | |
166 node_data->role = ui::AX_ROLE_ALERT_DIALOG; | |
167 } | |
168 | |
169 void ConflictingModuleView::OnConflictsAcknowledged() { | 169 void ConflictingModuleView::OnConflictsAcknowledged() { |
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 |