Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: ui/events/gesture_detection/gesture_detection_switches.cc

Issue 1049383003: Postpone rail application for touch scrolling - chrome side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698