cros: Convert "touch hud projection" from key shortcut/pref to flag
This debugging/presentation feature was tied to Ctrl-Alt-P. Usage is
very low per UMA metrics. We suspect most usage was from users
mistakenly hitting it when pressing Ctrl-P to print. Since it was tied
to a pref the user could get stuck in this state. It also didn't work
at the login screen and would turn on and off when switching
multiprofile users.
This feature is useful for debugging, recording videos of touch bugs,
and for projecting demos. UI review suggested moving it to about:flags
alongside the other touch debug flags.
* Remove the pref and add cleanup code to wipe the existing value.
* Remove the accelerator key.
* Add --show-taps. The name is inspired by the Android OS developer
option that does the same thing.
[email protected]
Bug: 786115
Test: existing ash_unittests
Change-Id: I07579bff6ab3dd16ec5c14347df1a047b1aa935c
Reviewed-on: https://chromium-review.googlesource.com/802075
Commit-Queue: James Cook <[email protected]>
Reviewed-by: Dominic Battré <[email protected]>
Reviewed-by: James Cook <[email protected]>
Reviewed-by: Ilya Sherman <[email protected]>
Reviewed-by: Michael Wasserman <[email protected]>
Cr-Commit-Position: refs/heads/master@{#521058}
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 90b5ed12..535debe 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -318,6 +318,26 @@
const char kInstantUIZeroSuggestUrlPrefix[] =
"instant_ui.zero_suggest_url_prefix";
+#if defined(OS_CHROMEOS)
+// Deprecated 12/2017.
+const char kTouchHudProjectionEnabled[] = "touch_hud.projection_enabled";
+#endif
+
+// Register prefs used only for migration (clearing or moving to a new key).
+void RegisterProfilePrefsForMigration(
+ user_prefs::PrefRegistrySyncable* registry) {
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ registry->RegisterDictionaryPref(kToolbarMigratedComponentActionStatus);
+#endif
+
+ registry->RegisterDictionaryPref(kDistroDict);
+ registry->RegisterStringPref(kInstantUIZeroSuggestUrlPrefix, std::string());
+
+#if defined(OS_CHROMEOS)
+ registry->RegisterBooleanPref(kTouchHudProjectionEnabled, false);
+#endif
+}
+
} // namespace
void RegisterLocalState(PrefRegistrySimple* registry) {
@@ -641,15 +661,6 @@
settings::MdSettingsUI::RegisterProfilePrefs(registry);
#endif
- // Preferences registered only for migration (clearing or moving to a new key)
- // go here.
-
-#if BUILDFLAG(ENABLE_EXTENSIONS)
- registry->RegisterDictionaryPref(kToolbarMigratedComponentActionStatus);
-#endif
-
- registry->RegisterDictionaryPref(kDistroDict);
-
#if BUILDFLAG(ENABLE_OFFLINE_PAGES)
offline_pages::OfflineMetricsCollectorImpl::RegisterPrefs(registry);
offline_pages::RegisterPrefetchBackgroundTaskPrefs(registry);
@@ -659,7 +670,7 @@
NotificationChannelsProviderAndroid::RegisterProfilePrefs(registry);
#endif
- registry->RegisterStringPref(kInstantUIZeroSuggestUrlPrefix, std::string());
+ RegisterProfilePrefsForMigration(registry);
}
void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
@@ -736,4 +747,9 @@
// Added 11/2017.
profile_prefs->ClearPref(kInstantUIZeroSuggestUrlPrefix);
+
+#if defined(OS_CHROMEOS)
+ // Added 12/2017.
+ profile_prefs->ClearPref(kTouchHudProjectionEnabled);
+#endif
}