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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 // A BrowsingDataRemover::Observer that clears all Profile data and then | 55 // A BrowsingDataRemover::Observer that clears all Profile data and then |
56 // invokes a callback and deletes itself. | 56 // invokes a callback and deletes itself. |
57 class ProfileDataRemover : public BrowsingDataRemover::Observer { | 57 class ProfileDataRemover : public BrowsingDataRemover::Observer { |
58 public: | 58 public: |
59 ProfileDataRemover(Profile* profile, const base::Closure& callback) | 59 ProfileDataRemover(Profile* profile, const base::Closure& callback) |
60 : callback_(callback), | 60 : callback_(callback), |
61 origin_runner_(base::ThreadTaskRunnerHandle::Get()), | 61 origin_runner_(base::ThreadTaskRunnerHandle::Get()), |
62 remover_(BrowsingDataRemoverFactory::GetForBrowserContext(profile)) { | 62 remover_(BrowsingDataRemoverFactory::GetForBrowserContext(profile)) { |
63 remover_->AddObserver(this); | 63 remover_->AddObserver(this); |
64 remover_->RemoveAndReply(BrowsingDataRemover::Unbounded(), | 64 remover_->RemoveAndReply(base::Time(), base::Time::Max(), |
65 BrowsingDataRemover::REMOVE_ALL, | 65 BrowsingDataRemover::REMOVE_ALL, |
66 BrowsingDataHelper::ALL, this); | 66 BrowsingDataHelper::ALL, this); |
67 } | 67 } |
68 | 68 |
69 ~ProfileDataRemover() override {} | 69 ~ProfileDataRemover() override {} |
70 | 70 |
71 void OnBrowsingDataRemoverDone() override { | 71 void OnBrowsingDataRemoverDone() override { |
72 remover_->RemoveObserver(this); | 72 remover_->RemoveObserver(this); |
73 origin_runner_->PostTask(FROM_HERE, callback_); | 73 origin_runner_->PostTask(FROM_HERE, callback_); |
74 origin_runner_->DeleteSoon(FROM_HERE, this); | 74 origin_runner_->DeleteSoon(FROM_HERE, this); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 const JavaParamRef<jstring>& j_email) { | 345 const JavaParamRef<jstring>& j_email) { |
346 std::string email = base::android::ConvertJavaStringToUTF8(env, j_email); | 346 std::string email = base::android::ConvertJavaStringToUTF8(env, j_email); |
347 std::string domain = gaia::ExtractDomainName(email); | 347 std::string domain = gaia::ExtractDomainName(email); |
348 return base::android::ConvertUTF8ToJavaString(env, domain); | 348 return base::android::ConvertUTF8ToJavaString(env, domain); |
349 } | 349 } |
350 | 350 |
351 // static | 351 // static |
352 bool SigninManagerAndroid::Register(JNIEnv* env) { | 352 bool SigninManagerAndroid::Register(JNIEnv* env) { |
353 return RegisterNativesImpl(env); | 353 return RegisterNativesImpl(env); |
354 } | 354 } |
OLD | NEW |