blob: 1bdc067e6c2c4db4d1f84db857559147fc9ac5d3 [file] [log] [blame]
Avi Drissman8ba1bad2022-09-13 19:22:361// Copyright 2018 The Chromium Authors
Mikel Astiz1f26c182018-08-01 05:04:292// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Mikel Astiz91c345c2023-05-16 14:18:565#ifndef COMPONENTS_SYNC_SERVICE_CONFIGURE_CONTEXT_H_
6#define COMPONENTS_SYNC_SERVICE_CONFIGURE_CONTEXT_H_
Mikel Astiz1f26c182018-08-01 05:04:297
8#include <string>
9
Peter Kastingb4ee3372021-07-06 23:02:2910#include "base/time/time.h"
Mikel Astiz453baf32025-04-15 08:42:3511#include "components/sync/base/previously_syncing_gaia_id_info_for_metrics.h"
Marc Treib659e6052019-09-18 10:49:0712#include "components/sync/base/sync_mode.h"
Mikel Astiz1f26c182018-08-01 05:04:2913#include "components/sync/engine/configure_reason.h"
Rushan Suleymanov3591a932025-04-23 05:26:1214#include "google_apis/gaia/gaia_id.h"
Mikel Astiz1f26c182018-08-01 05:04:2915
16namespace 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 Silvab7785422021-06-04 09:15:2121// SyncServiceImpl and plumbed through DataTypeManager until datatype
Mikel Astiz65d053d32025-03-27 10:27:4822// controllers, which propagate analogous information to the processor/bridge
23// via DataTypeActivationRequest.
Mikel Astiz1f26c182018-08-01 05:04:2924struct ConfigureContext {
Mikel Astiz453baf32025-04-15 08:42:3525 ConfigureContext();
26 ConfigureContext(const ConfigureContext&);
27 ~ConfigureContext();
28
Rushan Suleymanov3591a932025-04-23 05:26:1229 GaiaId authenticated_gaia_id;
Mikel Astiz1f26c182018-08-01 05:04:2930 std::string cache_guid;
Marc Treib659e6052019-09-18 10:49:0731 SyncMode sync_mode = SyncMode::kFull;
Mikel Astiz1f26c182018-08-01 05:04:2932 ConfigureReason reason = CONFIGURE_REASON_UNKNOWN;
Jan Krcald60d6b92018-11-21 19:41:4533 base::Time configuration_start_time;
Mikel Astiz453baf32025-04-15 08:42:3534 PreviouslySyncingGaiaIdInfoForMetrics previously_syncing_gaia_id_info =
35 PreviouslySyncingGaiaIdInfoForMetrics::kUnspecified;
Mikel Astiz1f26c182018-08-01 05:04:2936};
37
38} // namespace syncer
39
Mikel Astiz91c345c2023-05-16 14:18:5640#endif // COMPONENTS_SYNC_SERVICE_CONFIGURE_CONTEXT_H_