diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-23 17:21:03 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-23 16:25:15 +0000 |
commit | c551f43206405019121bd2b2c93714319a0a3300 (patch) | |
tree | 1f48c30631c421fd4bbb3c36da20183c8a2ed7d7 /chromium/components/consent_auditor | |
parent | 7961cea6d1041e3e454dae6a1da660b453efd238 (diff) | |
download | qtwebengine-chromium-c551f43206405019121bd2b2c93714319a0a3300.tar.gz |
BASELINE: Update Chromium to 79.0.3945.139
Change-Id: I336b7182fab9bca80b709682489c07db112eaca5
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/consent_auditor')
7 files changed, 32 insertions, 30 deletions
diff --git a/chromium/components/consent_auditor/DEPS b/chromium/components/consent_auditor/DEPS index c6d9382d566..ead2691e892 100644 --- a/chromium/components/consent_auditor/DEPS +++ b/chromium/components/consent_auditor/DEPS @@ -3,4 +3,5 @@ include_rules = [ "+components/prefs", "+components/sync", "+components/variations", + "+google_apis/gaia", ] diff --git a/chromium/components/consent_auditor/consent_auditor.h b/chromium/components/consent_auditor/consent_auditor.h index ff46df2807d..8914fa7368e 100644 --- a/chromium/components/consent_auditor/consent_auditor.h +++ b/chromium/components/consent_auditor/consent_auditor.h @@ -14,6 +14,7 @@ #include "base/memory/weak_ptr.h" #include "components/keyed_service/core/keyed_service.h" #include "components/sync/model/model_type_sync_bridge.h" +#include "google_apis/gaia/core_account_id.h" namespace consent_auditor { @@ -51,33 +52,33 @@ class ConsentAuditor : public KeyedService { // Records the ARC Play |consent| for the signed-in GAIA account with the ID // |account_id| (as defined in AccountInfo). virtual void RecordArcPlayConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::ArcPlayTermsOfServiceConsent& consent) = 0; // Records the ARC Google Location Service |consent| for the signed-in GAIA // account with the ID |account_id| (as defined in AccountInfo). virtual void RecordArcGoogleLocationServiceConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::ArcGoogleLocationServiceConsent& consent) = 0; // Records the ARC Backup and Restore |consent| for the signed-in GAIA // account with the ID |account_id| (as defined in AccountInfo). virtual void RecordArcBackupAndRestoreConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::ArcBackupAndRestoreConsent& consent) = 0; // Records the Sync |consent| for the signed-in GAIA account with the ID // |account_id| (as defined in AccountInfo). virtual void RecordSyncConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::SyncConsent& consent) = 0; // Records the Assistant activity control |consent| for the signed-in GAIA // account with the ID |accounts_id| (as defined in Account Info). virtual void RecordAssistantActivityControlConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::AssistantActivityControlConsent& consent) = 0; diff --git a/chromium/components/consent_auditor/consent_auditor_impl.cc b/chromium/components/consent_auditor/consent_auditor_impl.cc index 455d43342ab..80d2b9a1c0c 100644 --- a/chromium/components/consent_auditor/consent_auditor_impl.cc +++ b/chromium/components/consent_auditor/consent_auditor_impl.cc @@ -29,12 +29,12 @@ const char kLocalConsentVersionKey[] = "version"; const char kLocalConsentLocaleKey[] = "locale"; std::unique_ptr<sync_pb::UserConsentSpecifics> CreateUserConsentSpecifics( - const std::string& account_id, + const CoreAccountId& account_id, const std::string& locale, base::Clock* clock) { std::unique_ptr<sync_pb::UserConsentSpecifics> specifics = std::make_unique<sync_pb::UserConsentSpecifics>(); - specifics->set_account_id(account_id); + specifics->set_account_id(account_id.id); specifics->set_client_consent_time_usec( clock->Now().since_origin().InMicroseconds()); specifics->set_locale(locale); @@ -69,7 +69,7 @@ void ConsentAuditorImpl::RegisterProfilePrefs(PrefRegistrySimple* registry) { } void ConsentAuditorImpl::RecordArcPlayConsent( - const std::string& account_id, + const CoreAccountId& account_id, const ArcPlayTermsOfServiceConsent& consent) { std::unique_ptr<sync_pb::UserConsentSpecifics> specifics = CreateUserConsentSpecifics(account_id, app_locale_, clock_); @@ -81,7 +81,7 @@ void ConsentAuditorImpl::RecordArcPlayConsent( } void ConsentAuditorImpl::RecordArcGoogleLocationServiceConsent( - const std::string& account_id, + const CoreAccountId& account_id, const UserConsentTypes::ArcGoogleLocationServiceConsent& consent) { std::unique_ptr<sync_pb::UserConsentSpecifics> specifics = CreateUserConsentSpecifics(account_id, app_locale_, clock_); @@ -94,7 +94,7 @@ void ConsentAuditorImpl::RecordArcGoogleLocationServiceConsent( } void ConsentAuditorImpl::RecordArcBackupAndRestoreConsent( - const std::string& account_id, + const CoreAccountId& account_id, const UserConsentTypes::ArcBackupAndRestoreConsent& consent) { std::unique_ptr<sync_pb::UserConsentSpecifics> specifics = CreateUserConsentSpecifics(account_id, app_locale_, clock_); @@ -107,7 +107,7 @@ void ConsentAuditorImpl::RecordArcBackupAndRestoreConsent( } void ConsentAuditorImpl::RecordSyncConsent( - const std::string& account_id, + const CoreAccountId& account_id, const UserConsentTypes::SyncConsent& consent) { std::unique_ptr<sync_pb::UserConsentSpecifics> specifics = CreateUserConsentSpecifics(account_id, app_locale_, clock_); @@ -119,7 +119,7 @@ void ConsentAuditorImpl::RecordSyncConsent( } void ConsentAuditorImpl::RecordAssistantActivityControlConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::AssistantActivityControlConsent& consent) { std::unique_ptr<sync_pb::UserConsentSpecifics> specifics = CreateUserConsentSpecifics(account_id, app_locale_, clock_); diff --git a/chromium/components/consent_auditor/consent_auditor_impl.h b/chromium/components/consent_auditor/consent_auditor_impl.h index 57bb5d443cb..f8a66f8a5f5 100644 --- a/chromium/components/consent_auditor/consent_auditor_impl.h +++ b/chromium/components/consent_auditor/consent_auditor_impl.h @@ -42,22 +42,22 @@ class ConsentAuditorImpl : public ConsentAuditor { static void RegisterProfilePrefs(PrefRegistrySimple* registry); void RecordArcPlayConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::ArcPlayTermsOfServiceConsent& consent) override; void RecordArcGoogleLocationServiceConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::ArcGoogleLocationServiceConsent& consent) override; void RecordArcBackupAndRestoreConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::ArcBackupAndRestoreConsent& consent) override; void RecordSyncConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::SyncConsent& consent) override; void RecordAssistantActivityControlConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::AssistantActivityControlConsent& consent) override; void RecordLocalConsent(const std::string& feature, @@ -68,7 +68,7 @@ class ConsentAuditorImpl : public ConsentAuditor { private: std::unique_ptr<sync_pb::UserConsentSpecifics> ConstructUserConsentSpecifics( - const std::string& account_id, + const CoreAccountId& account_id, Feature feature, const std::vector<int>& description_grd_ids, int confirmation_grd_id, diff --git a/chromium/components/consent_auditor/consent_sync_bridge_impl_unittest.cc b/chromium/components/consent_auditor/consent_sync_bridge_impl_unittest.cc index 52006af37fb..89695be9a3c 100644 --- a/chromium/components/consent_auditor/consent_sync_bridge_impl_unittest.cc +++ b/chromium/components/consent_auditor/consent_sync_bridge_impl_unittest.cc @@ -164,7 +164,7 @@ class ConsentSyncBridgeImplTest : public testing::Test { } private: - base::test::TaskEnvironment task_environment_; + base::test::SingleThreadTaskEnvironment task_environment_; testing::NiceMock<MockModelTypeChangeProcessor> mock_processor_; std::unique_ptr<ConsentSyncBridgeImpl> bridge_; }; diff --git a/chromium/components/consent_auditor/fake_consent_auditor.cc b/chromium/components/consent_auditor/fake_consent_auditor.cc index 4543bfc48be..62c97791f47 100644 --- a/chromium/components/consent_auditor/fake_consent_auditor.cc +++ b/chromium/components/consent_auditor/fake_consent_auditor.cc @@ -32,7 +32,7 @@ FakeConsentAuditor::FakeConsentAuditor() {} FakeConsentAuditor::~FakeConsentAuditor() {} void FakeConsentAuditor::RecordSyncConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::SyncConsent& consent) { // TODO(markusheintz): Change the Fake to store the proto instead of calling // RecordGaiaConsent. @@ -44,13 +44,13 @@ void FakeConsentAuditor::RecordSyncConsent( } void FakeConsentAuditor::RecordAssistantActivityControlConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::AssistantActivityControlConsent& consent) { NOTIMPLEMENTED(); } void FakeConsentAuditor::RecordGaiaConsent( - const std::string& account_id, + const CoreAccountId& account_id, consent_auditor::Feature feature, const std::vector<int>& description_grd_ids, int confirmation_grd_id, diff --git a/chromium/components/consent_auditor/fake_consent_auditor.h b/chromium/components/consent_auditor/fake_consent_auditor.h index 8a00db12a6a..45bffeb5814 100644 --- a/chromium/components/consent_auditor/fake_consent_auditor.h +++ b/chromium/components/consent_auditor/fake_consent_auditor.h @@ -23,22 +23,22 @@ class FakeConsentAuditor : public ConsentAuditor { // ConsentAuditor implementation. void RecordSyncConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::SyncConsent& consent) override; MOCK_METHOD2( RecordArcPlayConsent, - void(const std::string&, + void(const CoreAccountId&, const sync_pb::UserConsentTypes::ArcPlayTermsOfServiceConsent&)); MOCK_METHOD2( RecordArcBackupAndRestoreConsent, - void(const std::string&, + void(const CoreAccountId&, const sync_pb::UserConsentTypes::ArcBackupAndRestoreConsent&)); MOCK_METHOD2( RecordArcGoogleLocationServiceConsent, - void(const std::string&, + void(const CoreAccountId&, const sync_pb::UserConsentTypes::ArcGoogleLocationServiceConsent&)); void RecordAssistantActivityControlConsent( - const std::string& account_id, + const CoreAccountId& account_id, const sync_pb::UserConsentTypes::AssistantActivityControlConsent& consent) override; @@ -50,13 +50,13 @@ class FakeConsentAuditor : public ConsentAuditor { // Methods for fake. // TODO(markusheintz): Replace the usage of this methods in all tests. - void RecordGaiaConsent(const std::string& account_id, + void RecordGaiaConsent(const CoreAccountId& account_id, consent_auditor::Feature feature, const std::vector<int>& description_grd_ids, int confirmation_grd_id, consent_auditor::ConsentStatus status); - const std::string& account_id() const { return account_id_; } + const CoreAccountId& account_id() const { return account_id_; } const sync_pb::UserConsentTypes::SyncConsent& recorded_sync_consent() const { return recorded_sync_consent_; @@ -82,7 +82,7 @@ class FakeConsentAuditor : public ConsentAuditor { } private: - std::string account_id_; + CoreAccountId account_id_; sync_pb::UserConsentTypes::SyncConsent recorded_sync_consent_; sync_pb::UserConsentTypes_ArcPlayTermsOfServiceConsent recorded_play_consent_; |