Commit e9569be8 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Chromium LUCI CQ

Convert components/ntp_snippets/* to OnPrimaryAccountChanged()

Methods OnPrimaryAccountSet/Cleared are deprecated. So this cl changes
these calls to OnPrimaryAccountChanged().

Bug: 1158855
Change-Id: Ie5a7880c7805f7a047345ee06111e78999db58ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2612891Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#841044}
parent 5ff24a2e
...@@ -501,14 +501,18 @@ void ContentSuggestionsService::OnSuggestionInvalidated( ...@@ -501,14 +501,18 @@ void ContentSuggestionsService::OnSuggestionInvalidated(
} }
} }
// signin::IdentityManager::Observer implementation // signin::IdentityManager::Observer implementation
void ContentSuggestionsService::OnPrimaryAccountSet( void ContentSuggestionsService::OnPrimaryAccountChanged(
const CoreAccountInfo& account_info) { const signin::PrimaryAccountChangeEvent& event_details) {
switch (event_details.GetEventTypeFor(signin::ConsentLevel::kSync)) {
case signin::PrimaryAccountChangeEvent::Type::kSet:
OnSignInStateChanged(/*has_signed_in=*/true); OnSignInStateChanged(/*has_signed_in=*/true);
} break;
case signin::PrimaryAccountChangeEvent::Type::kCleared:
void ContentSuggestionsService::OnPrimaryAccountCleared(
const CoreAccountInfo& account_info) {
OnSignInStateChanged(/*has_signed_in=*/false); OnSignInStateChanged(/*has_signed_in=*/false);
break;
case signin::PrimaryAccountChangeEvent::Type::kNone:
break;
}
} }
// history::HistoryServiceObserver implementation. // history::HistoryServiceObserver implementation.
......
...@@ -281,8 +281,8 @@ class ContentSuggestionsService : public KeyedService, ...@@ -281,8 +281,8 @@ class ContentSuggestionsService : public KeyedService,
const ContentSuggestion::ID& suggestion_id) override; const ContentSuggestion::ID& suggestion_id) override;
// signin::IdentityManager::Observer implementation. // signin::IdentityManager::Observer implementation.
void OnPrimaryAccountSet(const CoreAccountInfo& account_info) override; void OnPrimaryAccountChanged(
void OnPrimaryAccountCleared(const CoreAccountInfo& account_info) override; const signin::PrimaryAccountChangeEvent& event_details) override;
// history::HistoryServiceObserver implementation. // history::HistoryServiceObserver implementation.
void OnURLsDeleted(history::HistoryService* history_service, void OnURLsDeleted(history::HistoryService* history_service,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment