| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_H_ | 6 #define CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 ALL_PROFILES_SIGNED_IN, | 60 ALL_PROFILES_SIGNED_IN, |
| 61 ALL_PROFILES_NOT_SIGNED_IN, | 61 ALL_PROFILES_NOT_SIGNED_IN, |
| 62 MIXED_SIGNIN_STATUS, | 62 MIXED_SIGNIN_STATUS, |
| 63 UNKNOWN_SIGNIN_STATUS, | 63 UNKNOWN_SIGNIN_STATUS, |
| 64 ERROR_GETTING_SIGNIN_STATUS, | 64 ERROR_GETTING_SIGNIN_STATUS, |
| 65 SIGNIN_STATUS_MAX, | 65 SIGNIN_STATUS_MAX, |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 // chrome::BrowserListObserver: | 68 // chrome::BrowserListObserver: |
| 69 // This will never be called on Android. | 69 // This will never be called on Android. |
| 70 virtual void OnBrowserAdded(Browser* browser) OVERRIDE; | 70 virtual void OnBrowserAdded(Browser* browser) override; |
| 71 | 71 |
| 72 // SigninManagerFactory::Observer: | 72 // SigninManagerFactory::Observer: |
| 73 virtual void SigninManagerCreated(SigninManagerBase* manager) OVERRIDE; | 73 virtual void SigninManagerCreated(SigninManagerBase* manager) override; |
| 74 virtual void SigninManagerShutdown(SigninManagerBase* manager) OVERRIDE; | 74 virtual void SigninManagerShutdown(SigninManagerBase* manager) override; |
| 75 | 75 |
| 76 // SigninManagerBase::Observer: | 76 // SigninManagerBase::Observer: |
| 77 virtual void GoogleSigninSucceeded(const std::string& account_id, | 77 virtual void GoogleSigninSucceeded(const std::string& account_id, |
| 78 const std::string& username, | 78 const std::string& username, |
| 79 const std::string& password) OVERRIDE; | 79 const std::string& password) override; |
| 80 virtual void GoogleSignedOut(const std::string& account_id, | 80 virtual void GoogleSignedOut(const std::string& account_id, |
| 81 const std::string& username) OVERRIDE; | 81 const std::string& username) override; |
| 82 | 82 |
| 83 // Obtain sign-in status and add observers. | 83 // Obtain sign-in status and add observers. |
| 84 void Initialize(); | 84 void Initialize(); |
| 85 | 85 |
| 86 // Update the sign-in status based on all currently opened profiles. Called by | 86 // Update the sign-in status based on all currently opened profiles. Called by |
| 87 // ComputeCurrentSigninStatus at class construction and right after each UMA | 87 // ComputeCurrentSigninStatus at class construction and right after each UMA |
| 88 // log upload. |total_count| is the number of opened profiles and | 88 // log upload. |total_count| is the number of opened profiles and |
| 89 // |signed_in_count| represents the number of signed-in profiles among those | 89 // |signed_in_count| represents the number of signed-in profiles among those |
| 90 // |total_count| profiles. | 90 // |total_count| profiles. |
| 91 void UpdateInitialSigninStatus(size_t total_count, size_t signed_in_count); | 91 void UpdateInitialSigninStatus(size_t total_count, size_t signed_in_count); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 113 | 113 |
| 114 // Whether the instance is for testing or not. | 114 // Whether the instance is for testing or not. |
| 115 bool is_test_; | 115 bool is_test_; |
| 116 | 116 |
| 117 base::WeakPtrFactory<SigninStatusMetricsProvider> weak_ptr_factory_; | 117 base::WeakPtrFactory<SigninStatusMetricsProvider> weak_ptr_factory_; |
| 118 | 118 |
| 119 DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProvider); | 119 DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProvider); |
| 120 }; | 120 }; |
| 121 | 121 |
| 122 #endif // CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_H_ | 122 #endif // CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_H_ |
| OLD | NEW |