| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 return overscroll_prefs; | 58 return overscroll_prefs; |
| 59 } | 59 } |
| 60 | 60 |
| 61 // This class manages gesture configuration preferences. | 61 // This class manages gesture configuration preferences. |
| 62 class GesturePrefsObserver : public KeyedService { | 62 class GesturePrefsObserver : public KeyedService { |
| 63 public: | 63 public: |
| 64 explicit GesturePrefsObserver(PrefService* prefs); | 64 explicit GesturePrefsObserver(PrefService* prefs); |
| 65 virtual ~GesturePrefsObserver(); | 65 virtual ~GesturePrefsObserver(); |
| 66 | 66 |
| 67 // KeyedService implementation. | 67 // KeyedService implementation. |
| 68 virtual void Shutdown() OVERRIDE; | 68 virtual void Shutdown() override; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 // Notification callback invoked when browser-side preferences | 71 // Notification callback invoked when browser-side preferences |
| 72 // are updated and need to be pushed into ui::GesturePreferences. | 72 // are updated and need to be pushed into ui::GesturePreferences. |
| 73 void Update(); | 73 void Update(); |
| 74 | 74 |
| 75 // Notification callback invoked when the fling deacceleration | 75 // Notification callback invoked when the fling deacceleration |
| 76 // gesture preferences are changed from chrome://gesture. | 76 // gesture preferences are changed from chrome://gesture. |
| 77 // Broadcasts the changes all renderers where they are used. | 77 // Broadcasts the changes all renderers where they are used. |
| 78 void Notify(); | 78 void Notify(); |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 // Use same gesture preferences on incognito windows. | 243 // Use same gesture preferences on incognito windows. |
| 244 return chrome::GetBrowserContextRedirectedInIncognito(context); | 244 return chrome::GetBrowserContextRedirectedInIncognito(context); |
| 245 } | 245 } |
| 246 | 246 |
| 247 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const { | 247 bool GesturePrefsObserverFactoryAura::ServiceIsNULLWhileTesting() const { |
| 248 // Some tests replace the PrefService of the TestingProfile after the | 248 // Some tests replace the PrefService of the TestingProfile after the |
| 249 // GesturePrefsObserver has been created, which makes Shutdown() | 249 // GesturePrefsObserver has been created, which makes Shutdown() |
| 250 // remove the registrar from a non-existent PrefService. | 250 // remove the registrar from a non-existent PrefService. |
| 251 return true; | 251 return true; |
| 252 } | 252 } |
| OLD | NEW |