Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 1 | // Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "ash/public/cpp/ash_prefs.h" |
| 6 | |
Mike Wasserman | d13e95a | 2019-06-28 23:29:48 | [diff] [blame] | 7 | #include "ash/accessibility/accessibility_controller_impl.h" |
David Tseng | 00443a3 | 2021-03-24 22:24:13 | [diff] [blame] | 8 | #include "ash/accessibility/magnifier/docked_magnifier_controller_impl.h" |
wutao | 3a150d71b | 2020-02-19 22:11:26 | [diff] [blame] | 9 | #include "ash/ambient/ambient_controller.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 10 | #include "ash/app_list/app_list_controller_impl.h" |
David Black | ec4cbcd | 2020-04-15 20:35:25 | [diff] [blame] | 11 | #include "ash/assistant/assistant_controller_impl.h" |
Yulun Wu | 78c26ab | 2020-08-26 06:37:36 | [diff] [blame] | 12 | #include "ash/clipboard/clipboard_nudge_controller.h" |
Henrique Ferreiro | 3777026 | 2021-02-06 01:20:53 | [diff] [blame] | 13 | #include "ash/constants/ash_pref_names.h" |
Xiyuan Xia | 14619a2 | 2019-05-14 20:20:44 | [diff] [blame] | 14 | #include "ash/detachable_base/detachable_base_handler.h" |
| 15 | #include "ash/display/display_prefs.h" |
Gil Dekel | 6977703 | 2020-02-07 18:41:53 | [diff] [blame] | 16 | #include "ash/display/privacy_screen_controller.h" |
Chloe Pelling | 186ed3e | 2020-04-27 01:08:34 | [diff] [blame] | 17 | #include "ash/keyboard/keyboard_controller_impl.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 18 | #include "ash/login/login_screen_controller.h" |
Aya ElAttar | d2b3c8a | 2020-06-22 23:02:13 | [diff] [blame] | 19 | #include "ash/login/ui/login_expanded_public_account_view.h" |
Mia Bergeron | 12fd2f18 | 2019-06-11 23:04:46 | [diff] [blame] | 20 | #include "ash/media/media_controller_impl.h" |
Ana Salazar | eb7c2571 | 2020-02-03 20:27:26 | [diff] [blame] | 21 | #include "ash/public/cpp/ash_pref_names.h" |
Ahmed Mehfooz | e6167f5 | 2020-10-22 20:01:33 | [diff] [blame] | 22 | #include "ash/public/cpp/holding_space/holding_space_prefs.h" |
Xiaodan Zhu | d5b8187 | 2020-11-12 18:15:29 | [diff] [blame] | 23 | #include "ash/session/fullscreen_controller.h" |
Yulun Wu | 1e35513 | 2020-02-11 20:12:22 | [diff] [blame] | 24 | #include "ash/shelf/contextual_tooltip.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 25 | #include "ash/shelf/shelf_controller.h" |
minch | 308923f3 | 2020-08-28 18:58:30 | [diff] [blame] | 26 | #include "ash/style/ash_color_provider.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 27 | #include "ash/system/bluetooth/bluetooth_power_controller.h" |
| 28 | #include "ash/system/caps_lock_notification_controller.h" |
Ahmed Mehfooz | d618d6b | 2020-02-29 01:46:30 | [diff] [blame] | 29 | #include "ash/system/gesture_education/gesture_education_notification_controller.h" |
Jazz Xu | bfefcba | 2020-09-25 01:59:13 | [diff] [blame] | 30 | #include "ash/system/media/media_tray.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 31 | #include "ash/system/message_center/message_center_controller.h" |
Gordon Seto | 5623514d | 2021-01-27 23:52:28 | [diff] [blame] | 32 | #include "ash/system/network/cellular_setup_notifier.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 33 | #include "ash/system/network/vpn_list_view.h" |
Steven Bennetts | 32f5d55 | 2019-07-09 16:16:13 | [diff] [blame] | 34 | #include "ash/system/night_light/night_light_controller_impl.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 35 | #include "ash/system/palette/palette_tray.h" |
| 36 | #include "ash/system/palette/palette_welcome_bubble.h" |
Jimmy Gong | c6f4fd0 | 2021-02-25 01:55:00 | [diff] [blame] | 37 | #include "ash/system/pcie_peripheral/pcie_peripheral_notification_controller.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 38 | #include "ash/system/power/power_prefs.h" |
| 39 | #include "ash/system/session/logout_button_tray.h" |
Maria Petrisor | 878ea9f1 | 2021-04-14 17:55:09 | [diff] [blame] | 40 | #include "ash/system/session/logout_confirmation_controller.h" |
Aya ElAttar | fb1b9c6 | 2020-04-14 08:54:44 | [diff] [blame] | 41 | #include "ash/system/unified/top_shortcuts_view.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 42 | #include "ash/touch/touch_devices_controller.h" |
Mike Wasserman | a5352da | 2019-05-30 17:26:08 | [diff] [blame] | 43 | #include "ash/wallpaper/wallpaper_controller_impl.h" |
Ahmed Fakhry | 1d18fafe5 | 2020-02-24 22:40:36 | [diff] [blame] | 44 | #include "ash/wm/desks/desks_restore_util.h" |
Cattalyya Nuengsigkapian | f24c05b | 2021-01-15 02:51:18 | [diff] [blame] | 45 | #include "ash/wm/window_cycle/window_cycle_controller.h" |
Yue Li | d6f4cd3 | 2020-08-19 00:11:32 | [diff] [blame] | 46 | #include "chromeos/components/quick_answers/public/cpp/quick_answers_prefs.h" |
Yue Li | 4fa7285 | 2019-07-17 01:01:32 | [diff] [blame] | 47 | #include "chromeos/services/assistant/public/cpp/assistant_prefs.h" |
Amanda Deacon | 48669b4d | 2021-04-27 00:00:23 | [diff] [blame^] | 48 | #include "components/live_caption/pref_names.h" |
Ana Salazar | eb7c2571 | 2020-02-03 20:27:26 | [diff] [blame] | 49 | #include "components/pref_registry/pref_registry_syncable.h" |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 50 | |
| 51 | namespace ash { |
| 52 | |
| 53 | namespace { |
| 54 | |
| 55 | // Registers prefs whose default values are same in user and signin prefs. |
| 56 | void RegisterProfilePrefs(PrefRegistrySimple* registry, bool for_test) { |
James Cook | 025aa04 | 2019-10-18 23:16:32 | [diff] [blame] | 57 | AccessibilityControllerImpl::RegisterProfilePrefs(registry); |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 58 | AppListControllerImpl::RegisterProfilePrefs(registry); |
David Black | ec4cbcd | 2020-04-15 20:35:25 | [diff] [blame] | 59 | AssistantControllerImpl::RegisterProfilePrefs(registry); |
minch | 308923f3 | 2020-08-28 18:58:30 | [diff] [blame] | 60 | AshColorProvider::RegisterProfilePrefs(registry); |
wutao | 3a150d71b | 2020-02-19 22:11:26 | [diff] [blame] | 61 | AmbientController::RegisterProfilePrefs(registry); |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 62 | BluetoothPowerController::RegisterProfilePrefs(registry); |
| 63 | CapsLockNotificationController::RegisterProfilePrefs(registry, for_test); |
Gordon Seto | 5623514d | 2021-01-27 23:52:28 | [diff] [blame] | 64 | CellularSetupNotifier::RegisterProfilePrefs(registry); |
Yulun Wu | 1e35513 | 2020-02-11 20:12:22 | [diff] [blame] | 65 | contextual_tooltip::RegisterProfilePrefs(registry); |
Yulun Wu | 78c26ab | 2020-08-26 06:37:36 | [diff] [blame] | 66 | ClipboardNudgeController::RegisterProfilePrefs(registry); |
Ahmed Fakhry | 1d18fafe5 | 2020-02-24 22:40:36 | [diff] [blame] | 67 | desks_restore_util::RegisterProfilePrefs(registry); |
James Cook | 025aa04 | 2019-10-18 23:16:32 | [diff] [blame] | 68 | DockedMagnifierControllerImpl::RegisterProfilePrefs(registry); |
Xiaodan Zhu | d5b8187 | 2020-11-12 18:15:29 | [diff] [blame] | 69 | FullscreenController::RegisterProfilePrefs(registry); |
Ahmed Mehfooz | ccd31e16 | 2020-05-12 01:59:11 | [diff] [blame] | 70 | GestureEducationNotificationController::RegisterProfilePrefs(registry, |
| 71 | for_test); |
Ahmed Mehfooz | e6167f5 | 2020-10-22 20:01:33 | [diff] [blame] | 72 | holding_space_prefs::RegisterProfilePrefs(registry); |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 73 | LoginScreenController::RegisterProfilePrefs(registry, for_test); |
| 74 | LogoutButtonTray::RegisterProfilePrefs(registry); |
Maria Petrisor | 878ea9f1 | 2021-04-14 17:55:09 | [diff] [blame] | 75 | LogoutConfirmationController::RegisterProfilePrefs(registry); |
Chloe Pelling | 186ed3e | 2020-04-27 01:08:34 | [diff] [blame] | 76 | KeyboardControllerImpl::RegisterProfilePrefs(registry); |
Mia Bergeron | 12fd2f18 | 2019-06-11 23:04:46 | [diff] [blame] | 77 | MediaControllerImpl::RegisterProfilePrefs(registry); |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 78 | MessageCenterController::RegisterProfilePrefs(registry); |
Steven Bennetts | 32f5d55 | 2019-07-09 16:16:13 | [diff] [blame] | 79 | NightLightControllerImpl::RegisterProfilePrefs(registry); |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 80 | PaletteTray::RegisterProfilePrefs(registry); |
| 81 | PaletteWelcomeBubble::RegisterProfilePrefs(registry); |
Jimmy Gong | c6f4fd0 | 2021-02-25 01:55:00 | [diff] [blame] | 82 | PciePeripheralNotificationController::RegisterProfilePrefs(registry); |
Gil Dekel | 6977703 | 2020-02-07 18:41:53 | [diff] [blame] | 83 | PrivacyScreenController::RegisterProfilePrefs(registry); |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 84 | ShelfController::RegisterProfilePrefs(registry); |
Ana Salazar | eb7c2571 | 2020-02-03 20:27:26 | [diff] [blame] | 85 | TouchDevicesController::RegisterProfilePrefs(registry, for_test); |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 86 | tray::VPNListView::RegisterProfilePrefs(registry); |
Jazz Xu | bfefcba | 2020-09-25 01:59:13 | [diff] [blame] | 87 | MediaTray::RegisterProfilePrefs(registry); |
Qasid Sadiq | edba1f5 | 2021-04-05 18:56:03 | [diff] [blame] | 88 | WallpaperControllerImpl::RegisterProfilePrefs(registry); |
Cattalyya Nuengsigkapian | f24c05b | 2021-01-15 02:51:18 | [diff] [blame] | 89 | WindowCycleController::RegisterProfilePrefs(registry); |
James Cook | 4f3640d | 2019-11-19 00:40:35 | [diff] [blame] | 90 | |
Ana Salazar | eb7c2571 | 2020-02-03 20:27:26 | [diff] [blame] | 91 | // Provide prefs registered in the browser for ash_unittests. |
| 92 | if (for_test) { |
James Cook | 4f3640d | 2019-11-19 00:40:35 | [diff] [blame] | 93 | chromeos::assistant::prefs::RegisterProfilePrefs(registry); |
Yue Li | d6f4cd3 | 2020-08-19 00:11:32 | [diff] [blame] | 94 | chromeos::quick_answers::prefs::RegisterProfilePrefs(registry); |
Ana Salazar | eb7c2571 | 2020-02-03 20:27:26 | [diff] [blame] | 95 | registry->RegisterBooleanPref( |
| 96 | prefs::kMouseReverseScroll, false, |
| 97 | user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PRIORITY_PREF); |
Rachel Wong | 0eaed12 | 2020-10-21 14:46:01 | [diff] [blame] | 98 | registry->RegisterBooleanPref( |
| 99 | chromeos::prefs::kSuggestedContentEnabled, true, |
| 100 | user_prefs::PrefRegistrySyncable::SYNCABLE_OS_PREF); |
Abigail Klein | d1dd90b2 | 2020-12-04 18:02:28 | [diff] [blame] | 101 | registry->RegisterBooleanPref( |
Amanda Deacon | 48669b4d | 2021-04-27 00:00:23 | [diff] [blame^] | 102 | ::prefs::kLiveCaptionEnabled, false, |
| 103 | user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
Ana Salazar | eb7c2571 | 2020-02-03 20:27:26 | [diff] [blame] | 104 | } |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 105 | } |
| 106 | |
| 107 | } // namespace |
| 108 | |
Xiyuan Xia | 14619a2 | 2019-05-14 20:20:44 | [diff] [blame] | 109 | void RegisterLocalStatePrefs(PrefRegistrySimple* registry, bool for_test) { |
| 110 | PaletteTray::RegisterLocalStatePrefs(registry); |
Mike Wasserman | a5352da | 2019-05-30 17:26:08 | [diff] [blame] | 111 | WallpaperControllerImpl::RegisterLocalStatePrefs(registry); |
Xiyuan Xia | 14619a2 | 2019-05-14 20:20:44 | [diff] [blame] | 112 | BluetoothPowerController::RegisterLocalStatePrefs(registry); |
| 113 | DetachableBaseHandler::RegisterPrefs(registry); |
| 114 | PowerPrefs::RegisterLocalStatePrefs(registry); |
| 115 | DisplayPrefs::RegisterLocalStatePrefs(registry); |
Aya ElAttar | d2b3c8a | 2020-06-22 23:02:13 | [diff] [blame] | 116 | LoginExpandedPublicAccountView::RegisterLocalStatePrefs(registry); |
Aya ElAttar | fb1b9c6 | 2020-04-14 08:54:44 | [diff] [blame] | 117 | TopShortcutsView::RegisterLocalStatePrefs(registry); |
Xiyuan Xia | 14619a2 | 2019-05-14 20:20:44 | [diff] [blame] | 118 | } |
| 119 | |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 120 | void RegisterSigninProfilePrefs(PrefRegistrySimple* registry, bool for_test) { |
| 121 | RegisterProfilePrefs(registry, for_test); |
James Cook | ef1411e1 | 2019-10-18 23:49:22 | [diff] [blame] | 122 | PowerPrefs::RegisterSigninProfilePrefs(registry); |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 123 | } |
| 124 | |
| 125 | void RegisterUserProfilePrefs(PrefRegistrySimple* registry, bool for_test) { |
| 126 | RegisterProfilePrefs(registry, for_test); |
James Cook | ef1411e1 | 2019-10-18 23:49:22 | [diff] [blame] | 127 | PowerPrefs::RegisterUserProfilePrefs(registry); |
Xiyuan Xia | 5a8c417 | 2019-05-13 16:23:48 | [diff] [blame] | 128 | } |
| 129 | |
| 130 | } // namespace ash |