summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorachuith@chromium.org <achuith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-12 00:18:54 +0000
committerachuith@chromium.org <achuith@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-12 00:18:54 +0000
commit6fe635d08fc4956cdfc26d2a9ac46f85f5b36214 (patch)
treef58c28551afd86cd749b39661f706860f75f7fde
parenta9cde19aba88ab75887dc6f696e74f405c786e22 (diff)
downloadchromium_src-6fe635d08fc4956cdfc26d2a9ac46f85f5b36214.zip
chromium_src-6fe635d08fc4956cdfc26d2a9ac46f85f5b36214.tar.gz
chromium_src-6fe635d08fc4956cdfc26d2a9ac46f85f5b36214.tar.bz2
Use a command line flag instead of board to force natural scroll on.
BUG=152795 TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11099074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161456 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/preferences.cc17
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
3 files changed, 8 insertions, 13 deletions
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index 66c5989..73c2944 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -37,17 +37,6 @@
#include "unicode/timezone.h"
namespace chromeos {
-namespace {
-
-// TODO(achuith): Get rid of this.
-bool IsLink() {
- std::string board;
- system::StatisticsProvider::GetInstance()->GetMachineStatistic(
- "CHROMEOS_RELEASE_BOARD", &board);
- return StartsWithASCII(board, "link", false);
-}
-
-} // namespace
static const char kFallbackInputMethodLocale[] = "en-US";
@@ -424,8 +413,10 @@ void Preferences::NotifyPrefChanged(const std::string* pref_name) {
UMA_HISTOGRAM_BOOLEAN("Touchpad.ThreeFingerClick.Started", enabled);
}
if (!pref_name || *pref_name == prefs::kNaturalScroll) {
- // If user is on link, force natural scroll to on.
- if (IsLink() &&
+ // Force natural scroll to on if kNaturalScrollDefault is specified on the
+ // cmd line.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kNaturalScrollDefault) &&
!pref_name &&
!prefs_->GetUserPrefValue(prefs::kNaturalScroll)) {
natural_scroll_.SetValue(true);
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index e7da544..9bbcef2 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -1451,6 +1451,9 @@ const char kLoginUser[] = "login-user";
// Specifies a password to be used to login (along with login-user).
const char kLoginPassword[] = "login-password";
+// Enables natural scroll by default.
+const char kNaturalScrollDefault[] = "enable-natural-scroll-default";
+
// Disables tab discard in low memory conditions, a feature which silently
// closes inactive tabs to free memory and to attempt to avoid the kernel's
// out-of-memory process killer.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 9506895..be7f554 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -396,6 +396,7 @@ extern const char kLoginScreenSize[];
extern const char kLoginProfile[];
extern const char kLoginUser[];
extern const char kLoginPassword[];
+extern const char kNaturalScrollDefault[];
extern const char kNoDiscardTabs[];
extern const char kGuestSession[];
extern const char kEchoExtensionPath[];