| 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/system/tray/system_tray.h" | 7 #include "ash/common/system/tray/system_tray.h" |
| 8 #include "ash/common/system/tray_accessibility.h" | 8 #include "ash/common/system/tray_accessibility.h" |
| 9 #include "ash/magnifier/magnification_controller.h" | 9 #include "ash/magnifier/magnification_controller.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { | 99 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { |
| 100 if (GetParam() == PREF_SERVICE) { | 100 if (GetParam() == PREF_SERVICE) { |
| 101 PrefService* prefs = GetProfile()->GetPrefs(); | 101 PrefService* prefs = GetProfile()->GetPrefs(); |
| 102 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value); | 102 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value); |
| 103 } else if (GetParam() == POLICY) { | 103 } else if (GetParam() == POLICY) { |
| 104 policy::PolicyMap policy_map; | 104 policy::PolicyMap policy_map; |
| 105 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu, | 105 policy_map.Set(policy::key::kShowAccessibilityOptionsInSystemTrayMenu, |
| 106 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, | 106 policy::POLICY_LEVEL_MANDATORY, policy::POLICY_SCOPE_USER, |
| 107 policy::POLICY_SOURCE_CLOUD, | 107 policy::POLICY_SOURCE_CLOUD, |
| 108 base::WrapUnique(new base::FundamentalValue(value)), | 108 base::MakeUnique<base::FundamentalValue>(value), nullptr); |
| 109 nullptr); | |
| 110 provider_.UpdateChromePolicy(policy_map); | 109 provider_.UpdateChromePolicy(policy_map); |
| 111 base::RunLoop().RunUntilIdle(); | 110 base::RunLoop().RunUntilIdle(); |
| 112 } else { | 111 } else { |
| 113 FAIL() << "Unknown test parameterization"; | 112 FAIL() << "Unknown test parameterization"; |
| 114 } | 113 } |
| 115 } | 114 } |
| 116 | 115 |
| 117 ash::TrayAccessibility* tray() { | 116 ash::TrayAccessibility* tray() { |
| 118 return ash::Shell::GetInstance()->GetPrimarySystemTray()-> | 117 return ash::Shell::GetInstance()->GetPrimarySystemTray()-> |
| 119 GetTrayAccessibilityForTest(); | 118 GetTrayAccessibilityForTest(); |
| (...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 EXPECT_FALSE(IsSettingsShownOnDetailMenu()); | 902 EXPECT_FALSE(IsSettingsShownOnDetailMenu()); |
| 904 CloseDetailMenu(); | 903 CloseDetailMenu(); |
| 905 } | 904 } |
| 906 | 905 |
| 907 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, | 906 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, |
| 908 TrayAccessibilityTest, | 907 TrayAccessibilityTest, |
| 909 testing::Values(PREF_SERVICE, | 908 testing::Values(PREF_SERVICE, |
| 910 POLICY)); | 909 POLICY)); |
| 911 | 910 |
| 912 } // namespace chromeos | 911 } // namespace chromeos |
| OLD | NEW |