| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_STATUS_SERVICE_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_STATUS_SERVICE_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_STATUS_SERVICE_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_STATUS_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/scoped_observer.h" | 10 #include "base/scoped_observer.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 ~NTPSnippetsStatusService() override; | 37 ~NTPSnippetsStatusService() override; |
| 38 | 38 |
| 39 static void RegisterProfilePrefs(PrefRegistrySimple* registry); | 39 static void RegisterProfilePrefs(PrefRegistrySimple* registry); |
| 40 | 40 |
| 41 // Starts listening for changes from the dependencies. |callback| will be | 41 // Starts listening for changes from the dependencies. |callback| will be |
| 42 // called when a significant change in state is detected. | 42 // called when a significant change in state is detected. |
| 43 void Init(const DisabledReasonChangeCallback& callback); | 43 void Init(const DisabledReasonChangeCallback& callback); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsStatusServiceTest, | |
| 47 SigninStateCompatibility); | |
| 48 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsStatusServiceTest, DisabledViaPref); | 46 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsStatusServiceTest, DisabledViaPref); |
| 49 | 47 |
| 50 // SigninManagerBase::Observer implementation | 48 // SigninManagerBase::Observer implementation |
| 51 void GoogleSigninSucceeded(const std::string& account_id, | 49 void GoogleSigninSucceeded(const std::string& account_id, |
| 52 const std::string& username, | 50 const std::string& username, |
| 53 const std::string& password) override; | 51 const std::string& password) override; |
| 54 void GoogleSignedOut(const std::string& account_id, | 52 void GoogleSignedOut(const std::string& account_id, |
| 55 const std::string& username) override; | 53 const std::string& username) override; |
| 56 | 54 |
| 57 // Callback for the PrefChangeRegistrar. | 55 // Callback for the PrefChangeRegistrar. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 71 // The observer for the SigninManager. | 69 // The observer for the SigninManager. |
| 72 ScopedObserver<SigninManagerBase, SigninManagerBase::Observer> | 70 ScopedObserver<SigninManagerBase, SigninManagerBase::Observer> |
| 73 signin_observer_; | 71 signin_observer_; |
| 74 | 72 |
| 75 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsStatusService); | 73 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsStatusService); |
| 76 }; | 74 }; |
| 77 | 75 |
| 78 } // namespace ntp_snippets | 76 } // namespace ntp_snippets |
| 79 | 77 |
| 80 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_STATUS_SERVICE_H_ | 78 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_STATUS_SERVICE_H_ |
| OLD | NEW |