Avi Drissman | 8ba1bad | 2022-09-13 19:22:36 | [diff] [blame] | 1 | // Copyright 2018 The Chromium Authors |
Mikel Astiz | 1f26c18 | 2018-08-01 05:04:29 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Mikel Astiz | 91c345c | 2023-05-16 14:18:56 | [diff] [blame] | 5 | #ifndef COMPONENTS_SYNC_SERVICE_CONFIGURE_CONTEXT_H_ |
| 6 | #define COMPONENTS_SYNC_SERVICE_CONFIGURE_CONTEXT_H_ |
Mikel Astiz | 1f26c18 | 2018-08-01 05:04:29 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | |
Peter Kasting | b4ee337 | 2021-07-06 23:02:29 | [diff] [blame] | 10 | #include "base/time/time.h" |
Mikel Astiz | 453baf3 | 2025-04-15 08:42:35 | [diff] [blame] | 11 | #include "components/sync/base/previously_syncing_gaia_id_info_for_metrics.h" |
Marc Treib | 659e605 | 2019-09-18 10:49:07 | [diff] [blame] | 12 | #include "components/sync/base/sync_mode.h" |
Mikel Astiz | 1f26c18 | 2018-08-01 05:04:29 | [diff] [blame] | 13 | #include "components/sync/engine/configure_reason.h" |
Rushan Suleymanov | 3591a93 | 2025-04-23 05:26:12 | [diff] [blame] | 14 | #include "google_apis/gaia/gaia_id.h" |
Mikel Astiz | 1f26c18 | 2018-08-01 05:04:29 | [diff] [blame] | 15 | |
| 16 | namespace syncer { |
| 17 | |
| 18 | // Struct describing in which context sync was enabled, including state that can |
| 19 | // be assumed to be fixed while sync is enabled (or, more precisely, is |
| 20 | // representative of the last (re)configuration request). It's built by |
Victor Hugo Vianna Silva | b778542 | 2021-06-04 09:15:21 | [diff] [blame] | 21 | // SyncServiceImpl and plumbed through DataTypeManager until datatype |
Mikel Astiz | 65d053d3 | 2025-03-27 10:27:48 | [diff] [blame] | 22 | // controllers, which propagate analogous information to the processor/bridge |
| 23 | // via DataTypeActivationRequest. |
Mikel Astiz | 1f26c18 | 2018-08-01 05:04:29 | [diff] [blame] | 24 | struct ConfigureContext { |
Mikel Astiz | 453baf3 | 2025-04-15 08:42:35 | [diff] [blame] | 25 | ConfigureContext(); |
| 26 | ConfigureContext(const ConfigureContext&); |
| 27 | ~ConfigureContext(); |
| 28 | |
Rushan Suleymanov | 3591a93 | 2025-04-23 05:26:12 | [diff] [blame] | 29 | GaiaId authenticated_gaia_id; |
Mikel Astiz | 1f26c18 | 2018-08-01 05:04:29 | [diff] [blame] | 30 | std::string cache_guid; |
Marc Treib | 659e605 | 2019-09-18 10:49:07 | [diff] [blame] | 31 | SyncMode sync_mode = SyncMode::kFull; |
Mikel Astiz | 1f26c18 | 2018-08-01 05:04:29 | [diff] [blame] | 32 | ConfigureReason reason = CONFIGURE_REASON_UNKNOWN; |
Jan Krcal | d60d6b9 | 2018-11-21 19:41:45 | [diff] [blame] | 33 | base::Time configuration_start_time; |
Mikel Astiz | 453baf3 | 2025-04-15 08:42:35 | [diff] [blame] | 34 | PreviouslySyncingGaiaIdInfoForMetrics previously_syncing_gaia_id_info = |
| 35 | PreviouslySyncingGaiaIdInfoForMetrics::kUnspecified; |
Mikel Astiz | 1f26c18 | 2018-08-01 05:04:29 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | } // namespace syncer |
| 39 | |
Mikel Astiz | 91c345c | 2023-05-16 14:18:56 | [diff] [blame] | 40 | #endif // COMPONENTS_SYNC_SERVICE_CONFIGURE_CONTEXT_H_ |