| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/gesture_prefs_observer_factory_aura.h" | 5 #include "chrome/browser/ui/gesture_prefs_observer_factory_aura.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 const std::vector<OverscrollPref>& GetOverscrollPrefs() { | 48 const std::vector<OverscrollPref>& GetOverscrollPrefs() { |
| 49 CR_DEFINE_STATIC_LOCAL(std::vector<OverscrollPref>, overscroll_prefs, ()); | 49 CR_DEFINE_STATIC_LOCAL(std::vector<OverscrollPref>, overscroll_prefs, ()); |
| 50 if (overscroll_prefs.empty()) { | 50 if (overscroll_prefs.empty()) { |
| 51 using namespace content; | 51 using namespace content; |
| 52 const OverscrollPref kOverscrollPrefs[] = { | 52 const OverscrollPref kOverscrollPrefs[] = { |
| 53 { prefs::kOverscrollHorizontalThresholdComplete, | 53 { prefs::kOverscrollHorizontalThresholdComplete, |
| 54 OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE }, | 54 OVERSCROLL_CONFIG_HORIZ_THRESHOLD_COMPLETE }, |
| 55 { prefs::kOverscrollVerticalThresholdComplete, | 55 { prefs::kOverscrollVerticalThresholdComplete, |
| 56 OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE }, | 56 OVERSCROLL_CONFIG_VERT_THRESHOLD_COMPLETE }, |
| 57 { prefs::kOverscrollMinimumThresholdStart, | 57 { prefs::kOverscrollMinimumThresholdStart, |
| 58 OVERSCROLL_CONFIG_MIN_THRESHOLD_START }, | 58 OVERSCROLL_CONFIG_HORIZ_THRESHOLD_START }, |
| 59 { prefs::kOverscrollVerticalThresholdStart, |
| 60 OVERSCROLL_CONFIG_VERT_THRESHOLD_START }, |
| 59 { prefs::kOverscrollHorizontalResistThreshold, | 61 { prefs::kOverscrollHorizontalResistThreshold, |
| 60 OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER }, | 62 OVERSCROLL_CONFIG_HORIZ_RESIST_AFTER }, |
| 61 { prefs::kOverscrollVerticalResistThreshold, | 63 { prefs::kOverscrollVerticalResistThreshold, |
| 62 OVERSCROLL_CONFIG_VERT_RESIST_AFTER }, | 64 OVERSCROLL_CONFIG_VERT_RESIST_AFTER }, |
| 63 }; | 65 }; |
| 64 overscroll_prefs.assign(kOverscrollPrefs, | 66 overscroll_prefs.assign(kOverscrollPrefs, |
| 65 kOverscrollPrefs + arraysize(kOverscrollPrefs)); | 67 kOverscrollPrefs + arraysize(kOverscrollPrefs)); |
| 66 } | 68 } |
| 67 return overscroll_prefs; | 69 return overscroll_prefs; |
| 68 } | 70 } |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 // Use same gesture preferences on incognito windows. | 593 // Use same gesture preferences on incognito windows. |
| 592 return chrome::GetBrowserContextRedirectedInIncognito(context); | 594 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 593 } | 595 } |
| 594 | 596 |
| 595 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const { | 597 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const { |
| 596 // Some tests replace the PrefService of the TestingProfile after the | 598 // Some tests replace the PrefService of the TestingProfile after the |
| 597 // GesturePrefsObserver has been created, which makes Shutdown() | 599 // GesturePrefsObserver has been created, which makes Shutdown() |
| 598 // remove the registrar from a non-existent PrefService. | 600 // remove the registrar from a non-existent PrefService. |
| 599 return true; | 601 return true; |
| 600 } | 602 } |
| OLD | NEW |