| OLD | NEW |
| 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 #include "chrome/browser/android/signin/signin_manager_android.h" | 5 #include "chrome/browser/android/signin/signin_manager_android.h" |
| 6 | 6 |
| 7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
| 8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 // well, so that the next signin doesn't trigger the acount change dialog. | 201 // well, so that the next signin doesn't trigger the acount change dialog. |
| 202 profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesLastUsername); | 202 profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesLastUsername); |
| 203 | 203 |
| 204 Java_SigninManager_onProfileDataWiped(base::android::AttachCurrentThread(), | 204 Java_SigninManager_onProfileDataWiped(base::android::AttachCurrentThread(), |
| 205 java_signin_manager_.obj()); | 205 java_signin_manager_.obj()); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void SigninManagerAndroid::MergeSessionCompleted( | 208 void SigninManagerAndroid::MergeSessionCompleted( |
| 209 const std::string& account_id, | 209 const std::string& account_id, |
| 210 const GoogleServiceAuthError& error) { | 210 const GoogleServiceAuthError& error) { |
| 211 merge_session_helper_->RemoveObserver(this); |
| 211 merge_session_helper_.reset(); | 212 merge_session_helper_.reset(); |
| 212 } | 213 } |
| 213 | 214 |
| 214 void SigninManagerAndroid::LogInSignedInUser(JNIEnv* env, jobject obj) { | 215 void SigninManagerAndroid::LogInSignedInUser(JNIEnv* env, jobject obj) { |
| 215 if (switches::IsNewProfileManagement()) { | 216 if (switches::IsNewProfileManagement()) { |
| 216 // New Mirror code path that just fires the events and let the | 217 // New Mirror code path that just fires the events and let the |
| 217 // Account Reconcilor handles everything. | 218 // Account Reconcilor handles everything. |
| 218 AndroidProfileOAuth2TokenService* token_service = | 219 AndroidProfileOAuth2TokenService* token_service = |
| 219 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( | 220 ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile( |
| 220 profile_); | 221 profile_); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 250 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); | 251 return !policy::BrowserPolicyConnector::IsNonEnterpriseUser(username); |
| 251 #else | 252 #else |
| 252 return false; | 253 return false; |
| 253 #endif | 254 #endif |
| 254 } | 255 } |
| 255 | 256 |
| 256 // static | 257 // static |
| 257 bool SigninManagerAndroid::Register(JNIEnv* env) { | 258 bool SigninManagerAndroid::Register(JNIEnv* env) { |
| 258 return RegisterNativesImpl(env); | 259 return RegisterNativesImpl(env); |
| 259 } | 260 } |
| OLD | NEW |