Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3322)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java

Issue 2695113002: [Webview, Child Accounts] Automatically sign in to Chrome if needed. (Closed)
Patch Set: Fix instrumentation tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java b/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java
index 856da364c1a57ff19f32bbce32a2633baec69859..2992e12c6557010e441d6128863b27d56287d653 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java
@@ -12,15 +12,19 @@ import org.chromium.base.ThreadUtils;
import org.chromium.components.signin.AccountManagerHelper;
/**
- * This class serves as a simple interface for querying the child account information.
- * It has two methods namely, checkHasChildAccount(...) which is asynchronous and queries the
- * system directly for the information and the synchronous isChildAccount() which asks the native
- * side assuming it has been set correctly already.
+ * This class serves as a simple interface for querying the child account information. It has two
+ * methods for querying the child account information; checkHasChildAccount(...) which is
+ * asynchronous and queries the system directly for the information and the synchronous
+ * isChildAccount() which asks the native side assuming it has been set correctly already.
*
* The former method is used by ForcedSigninProcessor and FirstRunFlowSequencer to detect child
- * accounts since the native side is only activated on signing in.
- * Once signed in by the ForcedSigninProcessor, the ChildAccountInfoFetcher will notify the native
- * side and also takes responsibility for monitoring changes and taking a suitable action.
+ * accounts since the native side is only activated on signing in. Once signed in by the
+ * ForcedSigninProcessor, the ChildAccountInfoFetcher will notify the native side and also takes
+ * responsibility for monitoring changes and taking a suitable action.
+ *
+ * The class also provides an interface through which a client can listen for child account status
+ * changes. When the SupervisedUserContentProvider forces sign-in it waits for a status change
+ * before querying the URL filters.
*/
public class ChildAccountService {
private ChildAccountService() {
@@ -57,5 +61,15 @@ public class ChildAccountService {
return nativeIsChildAccount();
}
+ /**
+ * Set a callback to be called the next time a child account status change is received
+ * @param callback the callback to be called when the status changes.
+ */
+ public static void listenForStatusChange(Callback<Boolean> callback) {
+ nativeListenForChildStatusReceived(callback);
+ }
+
private static native boolean nativeIsChildAccount();
+
+ private static native void nativeListenForChildStatusReceived(Callback<Boolean> callback);
}
« no previous file with comments | « chrome/android/BUILD.gn ('k') | chrome/android/java/src/org/chromium/chrome/browser/firstrun/ForcedSigninProcessor.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698