| 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/common/accessibility_types.h" | 5 #include "ash/common/accessibility_types.h" |
| 6 #include "ash/common/login_status.h" | 6 #include "ash/common/login_status.h" |
| 7 #include "ash/common/material_design/material_design_controller.h" | |
| 8 #include "ash/common/system/tray/system_tray.h" | 7 #include "ash/common/system/tray/system_tray.h" |
| 9 #include "ash/common/system/tray_accessibility.h" | 8 #include "ash/common/system/tray_accessibility.h" |
| 10 #include "ash/common/test/test_session_state_delegate.h" | 9 #include "ash/common/test/test_session_state_delegate.h" |
| 11 #include "ash/magnifier/magnification_controller.h" | 10 #include "ash/magnifier/magnification_controller.h" |
| 12 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 13 #include "ash/test/shell_test_api.h" | 12 #include "ash/test/shell_test_api.h" |
| 14 #include "base/callback.h" | 13 #include "base/callback.h" |
| 15 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 16 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 232 |
| 234 bool IsAutoclickMenuShownOnDetailMenu() const { | 233 bool IsAutoclickMenuShownOnDetailMenu() const { |
| 235 return tray()->detailed_menu_->autoclick_view_; | 234 return tray()->detailed_menu_->autoclick_view_; |
| 236 } | 235 } |
| 237 | 236 |
| 238 bool IsVirtualKeyboardMenuShownOnDetailMenu() const { | 237 bool IsVirtualKeyboardMenuShownOnDetailMenu() const { |
| 239 return tray()->detailed_menu_->virtual_keyboard_view_; | 238 return tray()->detailed_menu_->virtual_keyboard_view_; |
| 240 } | 239 } |
| 241 | 240 |
| 242 // In material design we show the help button but theme it as disabled if | 241 // In material design we show the help button but theme it as disabled if |
| 243 // it is not possible to load the the help page. | 242 // it is not possible to load the help page. |
| 244 bool IsHelpAvailableOnDetailMenu() const { | 243 bool IsHelpAvailableOnDetailMenu() const { |
| 245 if (ash::MaterialDesignController::IsSystemTrayMenuMaterial()) { | 244 return tray()->detailed_menu_->help_view_->state() == |
| 246 return tray()->detailed_menu_->help_view_->state() == | 245 views::Button::STATE_NORMAL; |
| 247 views::Button::STATE_NORMAL; | |
| 248 } | |
| 249 return tray()->detailed_menu_->help_view_; | |
| 250 } | 246 } |
| 251 | 247 |
| 252 // In material design we show the settings button but theme it as disabled if | 248 // In material design we show the settings button but theme it as disabled if |
| 253 // it is not possible to load the the settings page. | 249 // it is not possible to load the settings page. |
| 254 bool IsSettingsAvailableOnDetailMenu() const { | 250 bool IsSettingsAvailableOnDetailMenu() const { |
| 255 if (ash::MaterialDesignController::IsSystemTrayMenuMaterial()) { | 251 return tray()->detailed_menu_->settings_view_->state() == |
| 256 return tray()->detailed_menu_->settings_view_->state() == | 252 views::Button::STATE_NORMAL; |
| 257 views::Button::STATE_NORMAL; | |
| 258 } | |
| 259 return tray()->detailed_menu_->settings_view_; | |
| 260 } | 253 } |
| 261 | 254 |
| 262 bool IsNotificationShown() const { | 255 bool IsNotificationShown() const { |
| 263 return (tray()->detailed_popup_ && | 256 return (tray()->detailed_popup_ && |
| 264 !tray()->detailed_popup_->GetWidget()->IsClosed()); | 257 !tray()->detailed_popup_->GetWidget()->IsClosed()); |
| 265 } | 258 } |
| 266 | 259 |
| 267 base::string16 GetNotificationText() const { | 260 base::string16 GetNotificationText() const { |
| 268 if (IsNotificationShown()) | 261 if (IsNotificationShown()) |
| 269 return tray()->detailed_popup_->label_for_test()->text(); | 262 return tray()->detailed_popup_->label_for_test()->text(); |
| (...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 EXPECT_FALSE(IsSettingsAvailableOnDetailMenu()); | 907 EXPECT_FALSE(IsSettingsAvailableOnDetailMenu()); |
| 915 CloseDetailMenu(); | 908 CloseDetailMenu(); |
| 916 } | 909 } |
| 917 | 910 |
| 918 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, | 911 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, |
| 919 TrayAccessibilityTest, | 912 TrayAccessibilityTest, |
| 920 testing::Values(PREF_SERVICE, | 913 testing::Values(PREF_SERVICE, |
| 921 POLICY)); | 914 POLICY)); |
| 922 | 915 |
| 923 } // namespace chromeos | 916 } // namespace chromeos |
| OLD | NEW |