| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CHROME_BROWSER_WEB_RESOURCE_EULA_ACCEPTED_NOTIFIER_H_ | 5 #ifndef CHROME_BROWSER_WEB_RESOURCE_EULA_ACCEPTED_NOTIFIER_H_ |
| 6 #define CHROME_BROWSER_WEB_RESOURCE_EULA_ACCEPTED_NOTIFIER_H_ | 6 #define CHROME_BROWSER_WEB_RESOURCE_EULA_ACCEPTED_NOTIFIER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/prefs/pref_change_registrar.h" | 9 #include "base/prefs/pref_change_registrar.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 // Initializes this class with the given |observer|. Must be called before | 26 // Initializes this class with the given |observer|. Must be called before |
| 27 // the class is used. | 27 // the class is used. |
| 28 void Init(Observer* observer); | 28 void Init(Observer* observer); |
| 29 | 29 |
| 30 // Returns true if the EULA has been accepted. If the EULA has not yet been | 30 // Returns true if the EULA has been accepted. If the EULA has not yet been |
| 31 // accepted, begins monitoring the EULA state and will notify the observer | 31 // accepted, begins monitoring the EULA state and will notify the observer |
| 32 // once the EULA has been accepted. | 32 // once the EULA has been accepted. |
| 33 virtual bool IsEulaAccepted(); | 33 virtual bool IsEulaAccepted(); |
| 34 | 34 |
| 35 // Factory method for this class. | 35 // Factory method for this class. |
| 36 static EulaAcceptedNotifier* Create(); | 36 static EulaAcceptedNotifier* Create(PrefService* local_state); |
| 37 | 37 |
| 38 protected: | 38 protected: |
| 39 // Notifies the observer that the EULA has been updated, made protected for | 39 // Notifies the observer that the EULA has been updated, made protected for |
| 40 // testing. | 40 // testing. |
| 41 void NotifyObserver(); | 41 void NotifyObserver(); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // Callback for EULA accepted pref change notification. | 44 // Callback for EULA accepted pref change notification. |
| 45 void OnPrefChanged(); | 45 void OnPrefChanged(); |
| 46 | 46 |
| 47 // Local state pref service for querying the EULA accepted pref. | 47 // Local state pref service for querying the EULA accepted pref. |
| 48 PrefService* local_state_; | 48 PrefService* local_state_; |
| 49 | 49 |
| 50 // Used to listen for the EULA accepted pref change notification. | 50 // Used to listen for the EULA accepted pref change notification. |
| 51 PrefChangeRegistrar registrar_; | 51 PrefChangeRegistrar registrar_; |
| 52 | 52 |
| 53 // Observer of the EULA accepted notification. | 53 // Observer of the EULA accepted notification. |
| 54 Observer* observer_; | 54 Observer* observer_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(EulaAcceptedNotifier); | 56 DISALLOW_COPY_AND_ASSIGN(EulaAcceptedNotifier); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 #endif // CHROME_BROWSER_WEB_RESOURCE_EULA_ACCEPTED_NOTIFIER_H_ | 59 #endif // CHROME_BROWSER_WEB_RESOURCE_EULA_ACCEPTED_NOTIFIER_H_ |
| OLD | NEW |