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

Unified Diff: ash/common/system/tray_accessibility.cc

Issue 2289223002: Make TrayDetailsView a ViewClickListener and ButtonListener (Closed)
Patch Set: fix test Created 4 years, 3 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
« no previous file with comments | « ash/common/system/tray_accessibility.h ('k') | ui/chromeos/network/network_list_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray_accessibility.cc
diff --git a/ash/common/system/tray_accessibility.cc b/ash/common/system/tray_accessibility.cc
index 16115fffdb883a85d04e415a80b8606b2200c025..093bee8923387a58c6af89ed6411a10aa4b47e09 100644
--- a/ash/common/system/tray_accessibility.cc
+++ b/ash/common/system/tray_accessibility.cc
@@ -152,7 +152,7 @@ AccessibilityDetailedView::AccessibilityDetailedView(SystemTrayItem* owner,
AppendAccessibilityList();
AppendHelpEntries();
- CreateSpecialRow(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_TITLE, this);
+ CreateTitleRow(IDS_ASH_STATUS_TRAY_ACCESSIBILITY_TITLE);
Layout();
}
@@ -244,40 +244,38 @@ HoverHighlightView* AccessibilityDetailedView::AddScrollListItem(
return container;
}
-void AccessibilityDetailedView::OnViewClicked(views::View* sender) {
+void AccessibilityDetailedView::HandleViewClicked(views::View* view) {
AccessibilityDelegate* delegate = WmShell::Get()->accessibility_delegate();
- if (sender == footer()->content()) {
- TransitionToDefaultView();
- } else if (sender == spoken_feedback_view_) {
+ if (view == spoken_feedback_view_) {
WmShell::Get()->RecordUserMetricsAction(
delegate->IsSpokenFeedbackEnabled()
? ash::UMA_STATUS_AREA_DISABLE_SPOKEN_FEEDBACK
: ash::UMA_STATUS_AREA_ENABLE_SPOKEN_FEEDBACK);
delegate->ToggleSpokenFeedback(A11Y_NOTIFICATION_NONE);
- } else if (sender == high_contrast_view_) {
+ } else if (view == high_contrast_view_) {
WmShell::Get()->RecordUserMetricsAction(
delegate->IsHighContrastEnabled()
? ash::UMA_STATUS_AREA_DISABLE_HIGH_CONTRAST
: ash::UMA_STATUS_AREA_ENABLE_HIGH_CONTRAST);
delegate->ToggleHighContrast();
- } else if (sender == screen_magnifier_view_) {
+ } else if (view == screen_magnifier_view_) {
WmShell::Get()->RecordUserMetricsAction(
delegate->IsMagnifierEnabled() ? ash::UMA_STATUS_AREA_DISABLE_MAGNIFIER
: ash::UMA_STATUS_AREA_ENABLE_MAGNIFIER);
delegate->SetMagnifierEnabled(!delegate->IsMagnifierEnabled());
- } else if (large_cursor_view_ && sender == large_cursor_view_) {
+ } else if (large_cursor_view_ && view == large_cursor_view_) {
WmShell::Get()->RecordUserMetricsAction(
delegate->IsLargeCursorEnabled()
? ash::UMA_STATUS_AREA_DISABLE_LARGE_CURSOR
: ash::UMA_STATUS_AREA_ENABLE_LARGE_CURSOR);
delegate->SetLargeCursorEnabled(!delegate->IsLargeCursorEnabled());
- } else if (autoclick_view_ && sender == autoclick_view_) {
+ } else if (autoclick_view_ && view == autoclick_view_) {
WmShell::Get()->RecordUserMetricsAction(
delegate->IsAutoclickEnabled()
? ash::UMA_STATUS_AREA_DISABLE_AUTO_CLICK
: ash::UMA_STATUS_AREA_ENABLE_AUTO_CLICK);
delegate->SetAutoclickEnabled(!delegate->IsAutoclickEnabled());
- } else if (virtual_keyboard_view_ && sender == virtual_keyboard_view_) {
+ } else if (virtual_keyboard_view_ && view == virtual_keyboard_view_) {
WmShell::Get()->RecordUserMetricsAction(
delegate->IsVirtualKeyboardEnabled()
? ash::UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD
@@ -286,8 +284,8 @@ void AccessibilityDetailedView::OnViewClicked(views::View* sender) {
}
}
-void AccessibilityDetailedView::ButtonPressed(views::Button* sender,
- const ui::Event& event) {
+void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender,
+ const ui::Event& event) {
SystemTrayDelegate* tray_delegate = WmShell::Get()->system_tray_delegate();
if (sender == help_view_)
tray_delegate->ShowAccessibilityHelp();
« no previous file with comments | « ash/common/system/tray_accessibility.h ('k') | ui/chromeos/network/network_list_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698