| 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "chrome/browser/android/signin/signin_manager_android.h" | 7 #include "chrome/browser/android/signin/signin_manager_android.h" |
| 8 | 8 |
| 9 #include "base/android/callback_android.h" | 9 #include "base/android/callback_android.h" |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 // A BrowsingDataRemover::Observer that clears all Profile data and then | 53 // A BrowsingDataRemover::Observer that clears all Profile data and then |
| 54 // invokes a callback and deletes itself. | 54 // invokes a callback and deletes itself. |
| 55 class ProfileDataRemover : public BrowsingDataRemover::Observer { | 55 class ProfileDataRemover : public BrowsingDataRemover::Observer { |
| 56 public: | 56 public: |
| 57 ProfileDataRemover(Profile* profile, const base::Closure& callback) | 57 ProfileDataRemover(Profile* profile, const base::Closure& callback) |
| 58 : callback_(callback), | 58 : callback_(callback), |
| 59 origin_runner_(base::ThreadTaskRunnerHandle::Get()), | 59 origin_runner_(base::ThreadTaskRunnerHandle::Get()), |
| 60 remover_(BrowsingDataRemoverFactory::GetForBrowserContext(profile)) { | 60 remover_(BrowsingDataRemoverFactory::GetForBrowserContext(profile)) { |
| 61 remover_->AddObserver(this); | 61 remover_->AddObserver(this); |
| 62 remover_->Remove(BrowsingDataRemover::Unbounded(), | 62 remover_->RemoveAndReply(BrowsingDataRemover::Unbounded(), |
| 63 BrowsingDataRemover::REMOVE_ALL, BrowsingDataHelper::ALL); | 63 BrowsingDataRemover::REMOVE_ALL, |
| 64 BrowsingDataHelper::ALL, this); |
| 64 } | 65 } |
| 65 | 66 |
| 66 ~ProfileDataRemover() override {} | 67 ~ProfileDataRemover() override {} |
| 67 | 68 |
| 68 void OnBrowsingDataRemoverDone() override { | 69 void OnBrowsingDataRemoverDone() override { |
| 69 remover_->RemoveObserver(this); | 70 remover_->RemoveObserver(this); |
| 70 origin_runner_->PostTask(FROM_HERE, callback_); | 71 origin_runner_->PostTask(FROM_HERE, callback_); |
| 71 origin_runner_->DeleteSoon(FROM_HERE, this); | 72 origin_runner_->DeleteSoon(FROM_HERE, this); |
| 72 } | 73 } |
| 73 | 74 |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 const JavaParamRef<jstring>& j_email) { | 339 const JavaParamRef<jstring>& j_email) { |
| 339 std::string email = base::android::ConvertJavaStringToUTF8(env, j_email); | 340 std::string email = base::android::ConvertJavaStringToUTF8(env, j_email); |
| 340 std::string domain = gaia::ExtractDomainName(email); | 341 std::string domain = gaia::ExtractDomainName(email); |
| 341 return base::android::ConvertUTF8ToJavaString(env, domain); | 342 return base::android::ConvertUTF8ToJavaString(env, domain); |
| 342 } | 343 } |
| 343 | 344 |
| 344 // static | 345 // static |
| 345 bool SigninManagerAndroid::Register(JNIEnv* env) { | 346 bool SigninManagerAndroid::Register(JNIEnv* env) { |
| 346 return RegisterNativesImpl(env); | 347 return RegisterNativesImpl(env); |
| 347 } | 348 } |
| OLD | NEW |