| 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 COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ | 5 #ifndef COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ |
| 6 #define COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ | 6 #define COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // |store_client_info| should back up client info to persistent storage such | 111 // |store_client_info| should back up client info to persistent storage such |
| 112 // that it is later retrievable by |load_client_info|. | 112 // that it is later retrievable by |load_client_info|. |
| 113 MetricsStateManager(PrefService* local_state, | 113 MetricsStateManager(PrefService* local_state, |
| 114 EnabledStateProvider* enabled_state_provider, | 114 EnabledStateProvider* enabled_state_provider, |
| 115 const StoreClientInfoCallback& store_client_info, | 115 const StoreClientInfoCallback& store_client_info, |
| 116 const LoadClientInfoCallback& load_client_info); | 116 const LoadClientInfoCallback& load_client_info); |
| 117 | 117 |
| 118 // Backs up the current client info via |store_client_info_|. | 118 // Backs up the current client info via |store_client_info_|. |
| 119 void BackUpCurrentClientInfo(); | 119 void BackUpCurrentClientInfo(); |
| 120 | 120 |
| 121 // Loads the client info via |load_client_info_| and potentially migrates it | 121 // Loads the client info via |load_client_info_|. |
| 122 // before returning it if it comes back in its old form. | 122 std::unique_ptr<ClientInfo> LoadClientInfo(); |
| 123 std::unique_ptr<ClientInfo> LoadClientInfoAndMaybeMigrate(); | |
| 124 | 123 |
| 125 // Returns the low entropy source for this client. This is a random value | 124 // Returns the low entropy source for this client. This is a random value |
| 126 // that is non-identifying amongst browser clients. This method will | 125 // that is non-identifying amongst browser clients. This method will |
| 127 // generate the entropy source value if it has not been called before. | 126 // generate the entropy source value if it has not been called before. |
| 128 int GetLowEntropySource(); | 127 int GetLowEntropySource(); |
| 129 | 128 |
| 130 // Generates the low entropy source value for this client if it is not | 129 // Generates the low entropy source value for this client if it is not |
| 131 // already set. | 130 // already set. |
| 132 void UpdateLowEntropySource(); | 131 void UpdateLowEntropySource(); |
| 133 | 132 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 EntropySourceType entropy_source_returned_; | 174 EntropySourceType entropy_source_returned_; |
| 176 | 175 |
| 177 std::unique_ptr<ClonedInstallDetector> cloned_install_detector_; | 176 std::unique_ptr<ClonedInstallDetector> cloned_install_detector_; |
| 178 | 177 |
| 179 DISALLOW_COPY_AND_ASSIGN(MetricsStateManager); | 178 DISALLOW_COPY_AND_ASSIGN(MetricsStateManager); |
| 180 }; | 179 }; |
| 181 | 180 |
| 182 } // namespace metrics | 181 } // namespace metrics |
| 183 | 182 |
| 184 #endif // COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ | 183 #endif // COMPONENTS_METRICS_METRICS_STATE_MANAGER_H_ |
| OLD | NEW |