| 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/accessibility_delegate.h" | 7 #include "ash/accessibility_delegate.h" |
| 8 #include "ash/accessibility_types.h" | 8 #include "ash/accessibility_types.h" |
| 9 #include "ash/resources/vector_icons/vector_icons.h" | 9 #include "ash/resources/vector_icons/vector_icons.h" |
| 10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/shell_port.h" |
| 12 #include "ash/strings/grit/ash_strings.h" | 13 #include "ash/strings/grit/ash_strings.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_controller.h" | 16 #include "ash/system/tray/system_tray_controller.h" |
| 16 #include "ash/system/tray/system_tray_delegate.h" | 17 #include "ash/system/tray/system_tray_delegate.h" |
| 17 #include "ash/system/tray/system_tray_notifier.h" | 18 #include "ash/system/tray/system_tray_notifier.h" |
| 18 #include "ash/system/tray/tray_constants.h" | 19 #include "ash/system/tray/tray_constants.h" |
| 19 #include "ash/system/tray/tray_details_view.h" | 20 #include "ash/system/tray/tray_details_view.h" |
| 20 #include "ash/system/tray/tray_item_more.h" | 21 #include "ash/system/tray/tray_item_more.h" |
| 21 #include "ash/system/tray/tray_popup_item_style.h" | 22 #include "ash/system/tray/tray_popup_item_style.h" |
| 22 #include "ash/system/tray/tray_popup_utils.h" | 23 #include "ash/system/tray/tray_popup_utils.h" |
| 23 #include "ash/system/tray/tri_view.h" | 24 #include "ash/system/tray/tri_view.h" |
| 24 #include "ash/wm_shell.h" | |
| 25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 28 #include "ui/gfx/image/image.h" | 28 #include "ui/gfx/image/image.h" |
| 29 #include "ui/gfx/paint_vector_icon.h" | 29 #include "ui/gfx/paint_vector_icon.h" |
| 30 #include "ui/resources/grit/ui_resources.h" | 30 #include "ui/resources/grit/ui_resources.h" |
| 31 #include "ui/views/background.h" | 31 #include "ui/views/background.h" |
| 32 #include "ui/views/controls/button/custom_button.h" | 32 #include "ui/views/controls/button/custom_button.h" |
| 33 #include "ui/views/controls/image_view.h" | 33 #include "ui/views/controls/image_view.h" |
| 34 #include "ui/views/controls/label.h" | 34 #include "ui/views/controls/label.h" |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 : ash::UMA_STATUS_AREA_ENABLE_STICKY_KEYS; | 391 : ash::UMA_STATUS_AREA_ENABLE_STICKY_KEYS; |
| 392 delegate->SetStickyKeysEnabled(!delegate->IsStickyKeysEnabled()); | 392 delegate->SetStickyKeysEnabled(!delegate->IsStickyKeysEnabled()); |
| 393 } else if (tap_dragging_view_ && view == tap_dragging_view_) { | 393 } else if (tap_dragging_view_ && view == tap_dragging_view_) { |
| 394 user_action = delegate->IsTapDraggingEnabled() | 394 user_action = delegate->IsTapDraggingEnabled() |
| 395 ? ash::UMA_STATUS_AREA_DISABLE_TAP_DRAGGING | 395 ? ash::UMA_STATUS_AREA_DISABLE_TAP_DRAGGING |
| 396 : ash::UMA_STATUS_AREA_ENABLE_TAP_DRAGGING; | 396 : ash::UMA_STATUS_AREA_ENABLE_TAP_DRAGGING; |
| 397 delegate->SetTapDraggingEnabled(!delegate->IsTapDraggingEnabled()); | 397 delegate->SetTapDraggingEnabled(!delegate->IsTapDraggingEnabled()); |
| 398 } else { | 398 } else { |
| 399 return; | 399 return; |
| 400 } | 400 } |
| 401 WmShell::Get()->RecordUserMetricsAction(user_action); | 401 ShellPort::Get()->RecordUserMetricsAction(user_action); |
| 402 } | 402 } |
| 403 | 403 |
| 404 void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender, | 404 void AccessibilityDetailedView::HandleButtonPressed(views::Button* sender, |
| 405 const ui::Event& event) { | 405 const ui::Event& event) { |
| 406 if (sender == help_view_) | 406 if (sender == help_view_) |
| 407 ShowHelp(); | 407 ShowHelp(); |
| 408 else if (sender == settings_view_) | 408 else if (sender == settings_view_) |
| 409 ShowSettings(); | 409 ShowSettings(); |
| 410 } | 410 } |
| 411 | 411 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 CHECK(detailed_popup_ == NULL); | 502 CHECK(detailed_popup_ == NULL); |
| 503 CHECK(detailed_menu_ == NULL); | 503 CHECK(detailed_menu_ == NULL); |
| 504 | 504 |
| 505 if (request_popup_view_state_) { | 505 if (request_popup_view_state_) { |
| 506 detailed_popup_ = | 506 detailed_popup_ = |
| 507 new tray::AccessibilityPopupView(request_popup_view_state_); | 507 new tray::AccessibilityPopupView(request_popup_view_state_); |
| 508 detailed_popup_->Init(); | 508 detailed_popup_->Init(); |
| 509 request_popup_view_state_ = A11Y_NONE; | 509 request_popup_view_state_ = A11Y_NONE; |
| 510 return detailed_popup_; | 510 return detailed_popup_; |
| 511 } else { | 511 } else { |
| 512 WmShell::Get()->RecordUserMetricsAction( | 512 ShellPort::Get()->RecordUserMetricsAction( |
| 513 ash::UMA_STATUS_AREA_DETAILED_ACCESSABILITY); | 513 ash::UMA_STATUS_AREA_DETAILED_ACCESSABILITY); |
| 514 detailed_menu_ = CreateDetailedMenu(); | 514 detailed_menu_ = CreateDetailedMenu(); |
| 515 return detailed_menu_; | 515 return detailed_menu_; |
| 516 } | 516 } |
| 517 } | 517 } |
| 518 | 518 |
| 519 void TrayAccessibility::DestroyDefaultView() { | 519 void TrayAccessibility::DestroyDefaultView() { |
| 520 default_ = NULL; | 520 default_ = NULL; |
| 521 } | 521 } |
| 522 | 522 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 if (detailed_popup_) | 559 if (detailed_popup_) |
| 560 detailed_popup_->GetWidget()->Close(); | 560 detailed_popup_->GetWidget()->Close(); |
| 561 if (detailed_menu_) | 561 if (detailed_menu_) |
| 562 detailed_menu_->GetWidget()->Close(); | 562 detailed_menu_->GetWidget()->Close(); |
| 563 } | 563 } |
| 564 | 564 |
| 565 previous_accessibility_state_ = accessibility_state; | 565 previous_accessibility_state_ = accessibility_state; |
| 566 } | 566 } |
| 567 | 567 |
| 568 } // namespace ash | 568 } // namespace ash |
| OLD | NEW |