Commit 7bc5f561 authored by Boris Sazonov's avatar Boris Sazonov Committed by Commit Bot

[Signin][Android] Add IdentityManager.Observer.onGaiaCookieDeletedByUserAction

Plumbs OnGaiaCookieDeletedByUserAction through JNI and exposes it to the
Java code.

Bug: 1095112
Change-Id: I0e47a48ba26f70c3e5d9706dca0904974ea2b852
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2410256Reviewed-by: default avatarAlice Wang <aliceywang@chromium.org>
Commit-Queue: Boris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807392}
parent 68c67102
...@@ -39,6 +39,12 @@ public class IdentityManager { ...@@ -39,6 +39,12 @@ public class IdentityManager {
* event). * event).
*/ */
void onPrimaryAccountCleared(CoreAccountInfo account); void onPrimaryAccountCleared(CoreAccountInfo account);
/**
* Called when the Gaia cookie has been deleted explicitly by a user action, e.g. from
* the settings.
*/
default void onAccountsCookieDeletedByUserAction() {}
} }
/** /**
* A simple callback for getAccessToken. * A simple callback for getAccessToken.
...@@ -111,6 +117,13 @@ public class IdentityManager { ...@@ -111,6 +117,13 @@ public class IdentityManager {
} }
} }
@CalledByNative
private void onAccountsCookieDeletedByUserAction() {
for (Observer observer : mObservers) {
observer.onAccountsCookieDeletedByUserAction();
}
}
/** /**
* Returns whether the user's primary account is available. * Returns whether the user's primary account is available.
*/ */
......
...@@ -576,6 +576,12 @@ void IdentityManager::OnGaiaCookieDeletedByUserAction() { ...@@ -576,6 +576,12 @@ void IdentityManager::OnGaiaCookieDeletedByUserAction() {
for (auto& observer : observer_list_) { for (auto& observer : observer_list_) {
observer.OnAccountsCookieDeletedByUserAction(); observer.OnAccountsCookieDeletedByUserAction();
} }
#if defined(OS_ANDROID)
if (java_identity_manager_) {
Java_IdentityManager_onAccountsCookieDeletedByUserAction(
base::android::AttachCurrentThread(), java_identity_manager_);
}
#endif
} }
void IdentityManager::OnAccessTokenRequested(const CoreAccountId& account_id, void IdentityManager::OnAccessTokenRequested(const CoreAccountId& account_id,
......
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