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

Side by Side Diff: chrome/browser/android/signin/signin_manager_android.h

Issue 1976423002: [sync] Sign user out of Chrome on dashboard stop and reset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_ANDROID_SIGNIN_SIGNIN_MANAGER_ANDROID_H_ 5 #ifndef CHROME_BROWSER_ANDROID_SIGNIN_SIGNIN_MANAGER_ANDROID_H_
6 #define CHROME_BROWSER_ANDROID_SIGNIN_SIGNIN_MANAGER_ANDROID_H_ 6 #define CHROME_BROWSER_ANDROID_SIGNIN_SIGNIN_MANAGER_ANDROID_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 12
13 #include "base/android/scoped_java_ref.h" 13 #include "base/android/scoped_java_ref.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "components/prefs/pref_change_registrar.h" 16 #include "components/prefs/pref_change_registrar.h"
17 #include "components/signin/core/browser/signin_manager.h"
maxbogue 2016/05/16 22:51:02 signin_manager_base.h, since that's the class you
Patrick Noland 2016/05/17 21:30:07 Done.
17 18
18 class Profile; 19 class Profile;
19 20
20 namespace policy { 21 namespace policy {
21 class CloudPolicyClient; 22 class CloudPolicyClient;
22 } 23 }
23 24
24 // Android wrapper of the SigninManager which provides access from the Java 25 // Android wrapper of the SigninManager which provides access from the Java
25 // layer. Note that on Android, there's only a single profile, and therefore 26 // layer. Note that on Android, there's only a single profile, and therefore
26 // a single instance of this wrapper. The name of the Java class is 27 // a single instance of this wrapper. The name of the Java class is
27 // SigninManager. 28 // SigninManager.
28 // This class should only be accessed from the UI thread. 29 // This class should only be accessed from the UI thread.
29 // 30 //
30 // This class implements parts of the sign-in flow, to make sure that policy 31 // This class implements parts of the sign-in flow, to make sure that policy
31 // is available before sign-in completes. 32 // is available before sign-in completes.
32 class SigninManagerAndroid { 33 class SigninManagerAndroid : public SigninManagerBase::Observer {
33 public: 34 public:
34 SigninManagerAndroid(JNIEnv* env, jobject obj); 35 SigninManagerAndroid(JNIEnv* env, jobject obj);
35 36
36 // Registers the SigninManagerAndroid's native methods through JNI. 37 // Registers the SigninManagerAndroid's native methods through JNI.
37 static bool Register(JNIEnv* env); 38 static bool Register(JNIEnv* env);
38 39
39 void CheckPolicyBeforeSignIn( 40 void CheckPolicyBeforeSignIn(
40 JNIEnv* env, 41 JNIEnv* env,
41 const base::android::JavaParamRef<jobject>& obj, 42 const base::android::JavaParamRef<jobject>& obj,
42 const base::android::JavaParamRef<jstring>& username); 43 const base::android::JavaParamRef<jstring>& username);
(...skipping 26 matching lines...) Expand all
69 void ClearLastSignedInUser(JNIEnv* env, 70 void ClearLastSignedInUser(JNIEnv* env,
70 const base::android::JavaParamRef<jobject>& obj); 71 const base::android::JavaParamRef<jobject>& obj);
71 72
72 jboolean IsSigninAllowedByPolicy( 73 jboolean IsSigninAllowedByPolicy(
73 JNIEnv* env, 74 JNIEnv* env,
74 const base::android::JavaParamRef<jobject>& obj); 75 const base::android::JavaParamRef<jobject>& obj);
75 76
76 jboolean IsSignedInOnNative(JNIEnv* env, 77 jboolean IsSignedInOnNative(JNIEnv* env,
77 const base::android::JavaParamRef<jobject>& obj); 78 const base::android::JavaParamRef<jobject>& obj);
78 79
80 void GoogleSigninFailed(const GoogleServiceAuthError& error) override;
maxbogue 2016/05/16 22:51:02 For implementations of interfaces, put a comment l
Patrick Noland 2016/05/17 21:30:07 Done.
81
82 void GoogleSigninSucceeded(const std::string& account_id,
83 const std::string& username,
84 const std::string& password) override;
85
86 void GoogleSignedOut(const std::string& account_id,
87 const std::string& username) override;
88
79 private: 89 private:
80 ~SigninManagerAndroid(); 90 ~SigninManagerAndroid() override;
81 91
82 void OnPolicyRegisterDone(const std::string& dm_token, 92 void OnPolicyRegisterDone(const std::string& dm_token,
83 const std::string& client_id); 93 const std::string& client_id);
84 void OnPolicyFetchDone(bool success); 94 void OnPolicyFetchDone(bool success);
85 95
86 void OnBrowsingDataRemoverDone( 96 void OnBrowsingDataRemoverDone(
87 const base::android::ScopedJavaGlobalRef<jobject>& callback); 97 const base::android::ScopedJavaGlobalRef<jobject>& callback);
88 98
89 void ClearLastSignedInUser(); 99 void ClearLastSignedInUser();
90 100
(...skipping 14 matching lines...) Expand all
105 std::string username_; 115 std::string username_;
106 116
107 PrefChangeRegistrar pref_change_registrar_; 117 PrefChangeRegistrar pref_change_registrar_;
108 118
109 base::WeakPtrFactory<SigninManagerAndroid> weak_factory_; 119 base::WeakPtrFactory<SigninManagerAndroid> weak_factory_;
110 120
111 DISALLOW_COPY_AND_ASSIGN(SigninManagerAndroid); 121 DISALLOW_COPY_AND_ASSIGN(SigninManagerAndroid);
112 }; 122 };
113 123
114 #endif // CHROME_BROWSER_ANDROID_SIGNIN_SIGNIN_MANAGER_ANDROID_H_ 124 #endif // CHROME_BROWSER_ANDROID_SIGNIN_SIGNIN_MANAGER_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698