diff options
author | ygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-26 15:05:03 +0000 |
---|---|---|
committer | ygorshenin@chromium.org <ygorshenin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-26 15:05:03 +0000 |
commit | 6078a71e7b8f99e84f3e859878a10a3afddf2eb6 (patch) | |
tree | a007c625443ea66c373073e1c6735945905a0ea5 /chrome | |
parent | c6bfa811ea72f1b5fc463c443762bef86a1747a6 (diff) | |
download | chromium_src-6078a71e7b8f99e84f3e859878a10a3afddf2eb6.zip chromium_src-6078a71e7b8f99e84f3e859878a10a3afddf2eb6.tar.gz chromium_src-6078a71e7b8f99e84f3e859878a10a3afddf2eb6.tar.bz2 |
Set up default tap to click and natural scroll.
BUG=chromium:122403
TEST=Manual testing on Alex device.
Review URL: http://codereview.chromium.org/10207011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134105 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chromeos/preferences.cc | 25 | ||||
-rw-r--r-- | chrome/browser/chromeos/preferences.h | 4 | ||||
-rw-r--r-- | chrome/browser/prefs/browser_prefs.cc | 1 |
3 files changed, 17 insertions, 13 deletions
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index f4bfd45..7667def 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -9,7 +9,6 @@ #include "base/i18n/time_formatting.h" #include "base/metrics/histogram.h" #include "base/string_split.h" -#include "base/string_util.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/input_method/input_method_manager.h" @@ -18,7 +17,6 @@ #include "chrome/browser/chromeos/login/login_utils.h" #include "chrome/browser/chromeos/system/input_device_settings.h" #include "chrome/browser/chromeos/system/screen_locker_settings.h" -#include "chrome/browser/chromeos/system/statistics_provider.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/prefs/scoped_user_pref_update.h" @@ -31,19 +29,15 @@ #include "ui/base/events.h" #include "unicode/timezone.h" -namespace chromeos { namespace { -// TODO(achuith): Use a cmd-line flag + use flags for this instead. -bool IsLumpy() { - std::string board; - system::StatisticsProvider::GetInstance()->GetMachineStatistic( - "CHROMEOS_RELEASE_BOARD", &board); - return StartsWithASCII(board, "lumpy", false); -} +const bool kDefaultTapToClickEnabled = true; +const bool kDefaultNaturalScrollEnabled = false; } // namespace +namespace chromeos { + static const char kFallbackInputMethodLocale[] = "en-US"; Preferences::Preferences() @@ -69,12 +63,11 @@ void Preferences::RegisterUserPrefs(PrefService* prefs) { hardware_keyboard_id = "xkb:us::eng"; // only for testing. } - const bool enable_tap_to_click_default = IsLumpy(); prefs->RegisterBooleanPref(prefs::kTapToClickEnabled, - enable_tap_to_click_default, + kDefaultTapToClickEnabled, PrefService::SYNCABLE_PREF); prefs->RegisterBooleanPref(prefs::kNaturalScroll, - false, + kDefaultNaturalScrollEnabled, PrefService::SYNCABLE_PREF); prefs->RegisterBooleanPref(prefs::kPrimaryMouseButtonRight, false, @@ -257,6 +250,12 @@ void Preferences::RegisterUserPrefs(PrefService* prefs) { PrefService::UNSYNCABLE_PREF); } +// static +void Preferences::SetDefaultOSSettings() { + system::touchpad_settings::SetTapToClick(kDefaultTapToClickEnabled); + ui::SetNaturalScroll(kDefaultNaturalScrollEnabled); +} + void Preferences::InitUserPrefs(PrefService* prefs) { tap_to_click_enabled_.Init(prefs::kTapToClickEnabled, prefs, this); natural_scroll_.Init(prefs::kNaturalScroll, prefs, this); diff --git a/chrome/browser/chromeos/preferences.h b/chrome/browser/chromeos/preferences.h index 7be9c3e..b622e8e 100644 --- a/chrome/browser/chromeos/preferences.h +++ b/chrome/browser/chromeos/preferences.h @@ -35,6 +35,10 @@ class Preferences : public content::NotificationObserver { // This method will register the prefs associated with Chrome OS settings. static void RegisterUserPrefs(PrefService* prefs); + // This method will set default OS settings like tap-to-click or + // natural scroll. + static void SetDefaultOSSettings(); + // This method is called when kLanguagePreferredVirtualKeyboard is updated to // change the virtual keyboard settings to reflect the new value. static void UpdateVirturalKeyboardPreference(PrefService* prefs); diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc index b6c93a3..3eaa9ef 100644 --- a/chrome/browser/prefs/browser_prefs.cc +++ b/chrome/browser/prefs/browser_prefs.cc @@ -232,6 +232,7 @@ void RegisterUserPrefs(PrefService* user_prefs) { #if defined(OS_CHROMEOS) chromeos::Preferences::RegisterUserPrefs(user_prefs); + chromeos::Preferences::SetDefaultOSSettings(); chromeos::ProxyConfigServiceImpl::RegisterPrefs(user_prefs); #endif |