Skip to content

Commit

Permalink
cros: remove for_test in register prefs in TouchDevicesController
Browse files Browse the repository at this point in the history
Bug: 817643
Test: compile and tests
Change-Id: Ib5d5e1e1caa0b467d900efa9f8f197e2ec6aa613
Reviewed-on: https://chromium-review.googlesource.com/1000116
Reviewed-by: James Cook <jamescook@chromium.org>
Commit-Queue: Qiang Xu <warx@google.com>
Cr-Commit-Position: refs/heads/master@{#548948}
  • Loading branch information
Qiang Xu authored and Commit Bot committed Apr 6, 2018
1 parent 200e5ec commit e534b67
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ash/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ void Shell::RegisterProfilePrefs(PrefRegistrySimple* registry, bool for_test) {
PaletteTray::RegisterProfilePrefs(registry);
PaletteWelcomeBubble::RegisterProfilePrefs(registry);
ShelfController::RegisterProfilePrefs(registry);
TouchDevicesController::RegisterProfilePrefs(registry, for_test);
TouchDevicesController::RegisterProfilePrefs(registry);
CapsLockNotificationController::RegisterProfilePrefs(registry, for_test);
}

Expand Down
20 changes: 6 additions & 14 deletions ash/touch/touch_devices_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,12 @@ PrefService* GetActivePrefService() {
} // namespace

// static
void TouchDevicesController::RegisterProfilePrefs(PrefRegistrySimple* registry,
bool for_test) {
if (for_test) {
// In tests there is no remote pref service. Make ash own the prefs.
registry->RegisterBooleanPref(
prefs::kTapDraggingEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF |
PrefRegistry::PUBLIC);
} else {
// In production the prefs are owned by chrome.
// TODO: Move ownership to ash.
registry->RegisterForeignPref(prefs::kTapDraggingEnabled);
}

void TouchDevicesController::RegisterProfilePrefs(
PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(
prefs::kTapDraggingEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF |
PrefRegistry::PUBLIC);
registry->RegisterBooleanPref(prefs::kTouchpadEnabled, PrefRegistry::PUBLIC);
registry->RegisterBooleanPref(prefs::kTouchscreenEnabled,
PrefRegistry::PUBLIC);
Expand Down
2 changes: 1 addition & 1 deletion ash/touch/touch_devices_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ASH_EXPORT TouchDevicesController : public SessionObserver {
TouchDevicesController();
~TouchDevicesController() override;

static void RegisterProfilePrefs(PrefRegistrySimple* registry, bool for_test);
static void RegisterProfilePrefs(PrefRegistrySimple* registry);

// Toggles the status of touchpad between enabled and disabled.
void ToggleTouchpad();
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/chromeos/preferences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,6 @@ void Preferences::RegisterProfilePrefs(
registry->RegisterBooleanPref(
ash::prefs::kShouldAlwaysShowAccessibilityMenu, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
ash::prefs::kTapDraggingEnabled, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF |
PrefRegistry::PUBLIC);

registry->RegisterIntegerPref(
prefs::kMouseSensitivity,
Expand Down

0 comments on commit e534b67

Please sign in to comment.