| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/system/tray_accessibility.h" | 5 #include "ash/system/tray_accessibility.h" |
| 6 | 6 |
| 7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/system/tray/system_tray_delegate.h" | 9 #include "ash/common/system/tray/system_tray_delegate.h" |
| 10 #include "ash/common/system/tray/tray_constants.h" | 10 #include "ash/common/system/tray/tray_constants.h" |
| 11 #include "ash/common/wm_shell.h" |
| 11 #include "ash/metrics/user_metrics_recorder.h" | 12 #include "ash/metrics/user_metrics_recorder.h" |
| 12 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 13 #include "ash/system/tray/hover_highlight_view.h" | 14 #include "ash/system/tray/hover_highlight_view.h" |
| 14 #include "ash/system/tray/system_tray.h" | 15 #include "ash/system/tray/system_tray.h" |
| 15 #include "ash/system/tray/system_tray_notifier.h" | 16 #include "ash/system/tray/system_tray_notifier.h" |
| 16 #include "ash/system/tray/tray_details_view.h" | 17 #include "ash/system/tray/tray_details_view.h" |
| 17 #include "ash/system/tray/tray_item_more.h" | 18 #include "ash/system/tray/tray_item_more.h" |
| 18 #include "ash/system/tray/tray_popup_label_button.h" | 19 #include "ash/system/tray/tray_popup_label_button.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 20 #include "base/strings/utf_string_conversions.h" |
| 20 #include "grit/ash_resources.h" | 21 #include "grit/ash_resources.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (delegate->IsAutoclickEnabled()) | 57 if (delegate->IsAutoclickEnabled()) |
| 57 state |= A11Y_AUTOCLICK; | 58 state |= A11Y_AUTOCLICK; |
| 58 if (delegate->IsVirtualKeyboardEnabled()) | 59 if (delegate->IsVirtualKeyboardEnabled()) |
| 59 state |= A11Y_VIRTUAL_KEYBOARD; | 60 state |= A11Y_VIRTUAL_KEYBOARD; |
| 60 if (delegate->IsBrailleDisplayConnected()) | 61 if (delegate->IsBrailleDisplayConnected()) |
| 61 state |= A11Y_BRAILLE_DISPLAY_CONNECTED; | 62 state |= A11Y_BRAILLE_DISPLAY_CONNECTED; |
| 62 return state; | 63 return state; |
| 63 } | 64 } |
| 64 | 65 |
| 65 LoginStatus GetCurrentLoginStatus() { | 66 LoginStatus GetCurrentLoginStatus() { |
| 66 return Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); | 67 return WmShell::Get()->system_tray_delegate()->GetUserLoginStatus(); |
| 67 } | 68 } |
| 68 | 69 |
| 69 } // namespace | 70 } // namespace |
| 70 | 71 |
| 71 namespace tray { | 72 namespace tray { |
| 72 | 73 |
| 73 class DefaultAccessibilityView : public TrayItemMore { | 74 class DefaultAccessibilityView : public TrayItemMore { |
| 74 public: | 75 public: |
| 75 explicit DefaultAccessibilityView(SystemTrayItem* owner) | 76 explicit DefaultAccessibilityView(SystemTrayItem* owner) |
| 76 : TrayItemMore(owner, true) { | 77 : TrayItemMore(owner, true) { |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 Shell::GetInstance()->metrics()->RecordUserMetricsAction( | 286 Shell::GetInstance()->metrics()->RecordUserMetricsAction( |
| 286 delegate->IsVirtualKeyboardEnabled() ? | 287 delegate->IsVirtualKeyboardEnabled() ? |
| 287 ash::UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD : | 288 ash::UMA_STATUS_AREA_DISABLE_VIRTUAL_KEYBOARD : |
| 288 ash::UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD); | 289 ash::UMA_STATUS_AREA_ENABLE_VIRTUAL_KEYBOARD); |
| 289 delegate->SetVirtualKeyboardEnabled(!delegate->IsVirtualKeyboardEnabled()); | 290 delegate->SetVirtualKeyboardEnabled(!delegate->IsVirtualKeyboardEnabled()); |
| 290 } | 291 } |
| 291 } | 292 } |
| 292 | 293 |
| 293 void AccessibilityDetailedView::ButtonPressed(views::Button* sender, | 294 void AccessibilityDetailedView::ButtonPressed(views::Button* sender, |
| 294 const ui::Event& event) { | 295 const ui::Event& event) { |
| 295 SystemTrayDelegate* tray_delegate = | 296 SystemTrayDelegate* tray_delegate = WmShell::Get()->system_tray_delegate(); |
| 296 Shell::GetInstance()->system_tray_delegate(); | |
| 297 if (sender == help_view_) | 297 if (sender == help_view_) |
| 298 tray_delegate->ShowAccessibilityHelp(); | 298 tray_delegate->ShowAccessibilityHelp(); |
| 299 else if (sender == settings_view_) | 299 else if (sender == settings_view_) |
| 300 tray_delegate->ShowAccessibilitySettings(); | 300 tray_delegate->ShowAccessibilitySettings(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 } // namespace tray | 303 } // namespace tray |
| 304 | 304 |
| 305 //////////////////////////////////////////////////////////////////////////////// | 305 //////////////////////////////////////////////////////////////////////////////// |
| 306 // ash::TrayAccessibility | 306 // ash::TrayAccessibility |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 if (detailed_popup_) | 423 if (detailed_popup_) |
| 424 detailed_popup_->GetWidget()->Close(); | 424 detailed_popup_->GetWidget()->Close(); |
| 425 if (detailed_menu_) | 425 if (detailed_menu_) |
| 426 detailed_menu_->GetWidget()->Close(); | 426 detailed_menu_->GetWidget()->Close(); |
| 427 } | 427 } |
| 428 | 428 |
| 429 previous_accessibility_state_ = accessibility_state; | 429 previous_accessibility_state_ = accessibility_state; |
| 430 } | 430 } |
| 431 | 431 |
| 432 } // namespace ash | 432 } // namespace ash |
| OLD | NEW |