| 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_REMOTE_NTP_SNIPPETS_STATUS_SERVICE_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_STATUS_SERVICE_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_STATUS_SERVICE_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsStatusServiceTest, DisabledViaPref); | 46 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsStatusServiceTest, DisabledViaPref); |
| 47 | 47 |
| 48 // SigninManagerBase::Observer implementation | 48 // SigninManagerBase::Observer implementation |
| 49 void GoogleSigninSucceeded(const std::string& account_id, | 49 void GoogleSigninSucceeded(const std::string& account_id, |
| 50 const std::string& username, | 50 const std::string& username, |
| 51 const std::string& password) override; | 51 const std::string& password) override; |
| 52 void GoogleSignedOut(const std::string& account_id, | 52 void GoogleSignedOut(const std::string& account_id, |
| 53 const std::string& username) override; | 53 const std::string& username) override; |
| 54 | 54 |
| 55 // Callback for the PrefChangeRegistrar. | 55 // Callback for the PrefChangeRegistrar. |
| 56 void OnStateChanged(); | 56 void OnSnippetsEnabledChanged(); |
| 57 |
| 58 void OnStateChanged(DisabledReason new_disabled_reason); |
| 57 | 59 |
| 58 DisabledReason GetDisabledReasonFromDeps() const; | 60 DisabledReason GetDisabledReasonFromDeps() const; |
| 59 | 61 |
| 60 DisabledReason disabled_reason_; | 62 DisabledReason disabled_reason_; |
| 61 DisabledReasonChangeCallback disabled_reason_change_callback_; | 63 DisabledReasonChangeCallback disabled_reason_change_callback_; |
| 62 | 64 |
| 63 bool require_signin_; | 65 bool require_signin_; |
| 64 SigninManagerBase* signin_manager_; | 66 SigninManagerBase* signin_manager_; |
| 65 PrefService* pref_service_; | 67 PrefService* pref_service_; |
| 66 | 68 |
| 67 PrefChangeRegistrar pref_change_registrar_; | 69 PrefChangeRegistrar pref_change_registrar_; |
| 68 | 70 |
| 69 // The observer for the SigninManager. | 71 // The observer for the SigninManager. |
| 70 ScopedObserver<SigninManagerBase, SigninManagerBase::Observer> | 72 ScopedObserver<SigninManagerBase, SigninManagerBase::Observer> |
| 71 signin_observer_; | 73 signin_observer_; |
| 72 | 74 |
| 73 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsStatusService); | 75 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsStatusService); |
| 74 }; | 76 }; |
| 75 | 77 |
| 76 } // namespace ntp_snippets | 78 } // namespace ntp_snippets |
| 77 | 79 |
| 78 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_STATUS_SERVICE_H_ | 80 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_STATUS_SERVICE_H_ |
| OLD | NEW |