diff options
-rw-r--r-- | chrome/browser/chromeos/chrome_browser_main_chromeos.cc | 5 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/chrome_restart_request.cc | 1 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/login_display_host_impl.cc | 4 | ||||
-rw-r--r-- | chrome/browser/chromeos/preferences.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc | 5 | ||||
-rw-r--r-- | chromeos/chromeos_switches.cc | 3 | ||||
-rw-r--r-- | chromeos/chromeos_switches.h | 1 |
7 files changed, 20 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index 52b3d45..0ea6beb 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc @@ -644,8 +644,11 @@ void ChromeBrowserMainPartsChromeos::PreBrowserStart() { // adjusting the oom priority. g_browser_process->platform_part()->oom_priority_manager()->Start(); - if (ui::ShouldDefaultToNaturalScroll()) + if (ui::ShouldDefaultToNaturalScroll()) { + CommandLine::ForCurrentProcess()->AppendSwitch( + chromeos::switches::kNaturalScrollDefault); ui::SetNaturalScroll(true); + } ChromeBrowserMainPartsLinux::PreBrowserStart(); } diff --git a/chrome/browser/chromeos/login/chrome_restart_request.cc b/chrome/browser/chromeos/login/chrome_restart_request.cc index 7be032f..e921b95 100644 --- a/chrome/browser/chromeos/login/chrome_restart_request.cc +++ b/chrome/browser/chromeos/login/chrome_restart_request.cc @@ -193,6 +193,7 @@ std::string DeriveCommandLine(const GURL& start_url, chromeos::switches::kHasChromeOSDiamondKey, chromeos::switches::kHasChromeOSKeyboard, chromeos::switches::kLoginProfile, + chromeos::switches::kNaturalScrollDefault, ::switches::kEnableBrowserTextSubpixelPositioning, ::switches::kEnableWebkitTextSubpixelPositioning, views::corewm::switches::kNoDropShadows, diff --git a/chrome/browser/chromeos/login/login_display_host_impl.cc b/chrome/browser/chromeos/login/login_display_host_impl.cc index 19c9c20..eccaf7f 100644 --- a/chrome/browser/chromeos/login/login_display_host_impl.cc +++ b/chrome/browser/chromeos/login/login_display_host_impl.cc @@ -66,6 +66,7 @@ #include "ui/compositor/layer.h" #include "ui/compositor/layer_animation_observer.h" #include "ui/compositor/scoped_layer_animation_settings.h" +#include "ui/events/event_utils.h" #include "ui/gfx/rect.h" #include "ui/gfx/transform.h" #include "ui/views/focus/focus_manager.h" @@ -920,6 +921,9 @@ void ShowLoginWizard(const std::string& first_screen_name) { prefs->GetBoolean(prefs::kOwnerTapToClickEnabled)); } + ui::SetNaturalScroll(CommandLine::ForCurrentProcess()->HasSwitch( + switches::kNaturalScrollDefault)); + gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); // Check whether we need to execute OOBE process. diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc index 5af8afe..c014ff7 100644 --- a/chrome/browser/chromeos/preferences.cc +++ b/chrome/browser/chromeos/preferences.cc @@ -116,7 +116,8 @@ void Preferences::RegisterProfilePrefs( user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); registry->RegisterBooleanPref( prefs::kNaturalScroll, - ui::ShouldDefaultToNaturalScroll(), + CommandLine::ForCurrentProcess()->HasSwitch( + switches::kNaturalScrollDefault), user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF); registry->RegisterBooleanPref( prefs::kPrimaryMouseButtonRight, @@ -585,7 +586,8 @@ void Preferences::OnIsSyncingChanged() { void Preferences::ForceNaturalScrollDefault() { DVLOG(1) << "ForceNaturalScrollDefault"; - if (ui::ShouldDefaultToNaturalScroll() && + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kNaturalScrollDefault) && prefs_->IsSyncing() && !prefs_->GetUserPrefValue(prefs::kNaturalScroll)) { DVLOG(1) << "Natural scroll forced to true"; diff --git a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc index f4ba727..46862e6 100644 --- a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc +++ b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc @@ -41,6 +41,9 @@ class TabScrubberTest : public InProcessBrowserTest, } virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { +#if defined(OS_CHROMEOS) + command_line->AppendSwitch(chromeos::switches::kNaturalScrollDefault); +#endif command_line->AppendSwitch(switches::kOpenAsh); } @@ -51,8 +54,6 @@ class TabScrubberTest : public InProcessBrowserTest, ash::Shell* shell = ash::Shell::GetInstance(); shell->event_transformation_handler()->set_transformation_mode( ash::internal::EventTransformationHandler::TRANSFORM_NONE); - - ui::SetNaturalScroll(true); } virtual void CleanUpOnMainThread() OVERRIDE { diff --git a/chromeos/chromeos_switches.cc b/chromeos/chromeos_switches.cc index b9af049..42ffe24 100644 --- a/chromeos/chromeos_switches.cc +++ b/chromeos/chromeos_switches.cc @@ -157,6 +157,9 @@ const char kLoginProfile[] = "login-profile"; // Specifies the user which is already logged in. const char kLoginUser[] = "login-user"; +// Enables natural scroll by default. +const char kNaturalScrollDefault[] = "enable-natural-scroll-default"; + // Skips all other OOBE pages after user login. const char kOobeSkipPostLogin[] = "oobe-skip-postlogin"; diff --git a/chromeos/chromeos_switches.h b/chromeos/chromeos_switches.h index d00d9a9..7218df3 100644 --- a/chromeos/chromeos_switches.h +++ b/chromeos/chromeos_switches.h @@ -62,6 +62,7 @@ CHROMEOS_EXPORT extern const char kLoginManager[]; CHROMEOS_EXPORT extern const char kLoginPassword[]; CHROMEOS_EXPORT extern const char kLoginProfile[]; CHROMEOS_EXPORT extern const char kLoginUser[]; +CHROMEOS_EXPORT extern const char kNaturalScrollDefault[]; CHROMEOS_EXPORT extern const char kOobeSkipPostLogin[]; CHROMEOS_EXPORT extern const char kSkipHWIDCheck[]; CHROMEOS_EXPORT extern const char kSmsTestMessages[]; |