OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/events/gesture_detection/gesture_detection_switches.h" |
| 6 |
| 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" |
| 9 |
| 10 namespace switches { |
| 11 |
| 12 // Postpone the application of scroll rails until after gesture |
| 13 // recognition. This will result in views logic seeing unrailed |
| 14 // scrolls. See crbug.com/469789 for details, and crbug.com/472223 for |
| 15 // the bug to remove this flag. |
| 16 const char kScrollRailsPostponed[] = "scroll-rails-postponed"; |
| 17 const char kScrollRailsPostponedAuto[] = "auto"; |
| 18 const char kScrollRailsPostponedEnabled[] = "enabled"; |
| 19 const char kScrollRailsPostponedDisabled[] = "disabled"; |
| 20 |
| 21 } // namespace switches |
| 22 |
| 23 namespace ui { |
| 24 |
| 25 bool PostponeRailApplication() { |
| 26 const base::CommandLine& command_line = |
| 27 *base::CommandLine::ForCurrentProcess(); |
| 28 const std::string scroll_rails_postponed_switch = |
| 29 command_line.HasSwitch(switches::kScrollRailsPostponed) ? |
| 30 command_line.GetSwitchValueASCII(switches::kScrollRailsPostponed) : |
| 31 switches::kScrollRailsPostponedAuto; |
| 32 bool default_value = true; |
| 33 |
| 34 if (scroll_rails_postponed_switch == switches::kScrollRailsPostponedEnabled) |
| 35 return true; |
| 36 if (scroll_rails_postponed_switch == switches::kScrollRailsPostponedDisabled) |
| 37 return false; |
| 38 if (scroll_rails_postponed_switch == switches::kScrollRailsPostponedAuto) |
| 39 return default_value; |
| 40 LOG(ERROR) << "Invalid --scroll-rails-postponed option: " |
| 41 << scroll_rails_postponed_switch; |
| 42 return default_value; |
| 43 } |
| 44 |
| 45 } // namespace ui |
OLD | NEW |