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

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

Issue 2578723002: Reduce BrowsingDataRemover's dependencies on Chrome (Closed)
Patch Set: Created 4 years 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 #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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // A BrowsingDataRemover::Observer that clears all Profile data and then 54 // A BrowsingDataRemover::Observer that clears all Profile data and then
55 // invokes a callback and deletes itself. 55 // invokes a callback and deletes itself.
56 class ProfileDataRemover : public BrowsingDataRemover::Observer { 56 class ProfileDataRemover : public BrowsingDataRemover::Observer {
57 public: 57 public:
58 ProfileDataRemover(Profile* profile, const base::Closure& callback) 58 ProfileDataRemover(Profile* profile, const base::Closure& callback)
59 : callback_(callback), 59 : callback_(callback),
60 origin_runner_(base::ThreadTaskRunnerHandle::Get()), 60 origin_runner_(base::ThreadTaskRunnerHandle::Get()),
61 remover_(BrowsingDataRemoverFactory::GetForBrowserContext(profile)) { 61 remover_(BrowsingDataRemoverFactory::GetForBrowserContext(profile)) {
62 remover_->AddObserver(this); 62 remover_->AddObserver(this);
63 remover_->RemoveAndReply(BrowsingDataRemover::Unbounded(), 63 remover_->RemoveAndReply(base::Time(), base::Time::Max(),
64 BrowsingDataRemover::REMOVE_ALL, 64 BrowsingDataRemover::REMOVE_ALL,
65 BrowsingDataHelper::ALL, this); 65 BrowsingDataHelper::ALL, this);
66 } 66 }
67 67
68 ~ProfileDataRemover() override {} 68 ~ProfileDataRemover() override {}
69 69
70 void OnBrowsingDataRemoverDone() override { 70 void OnBrowsingDataRemoverDone() override {
71 remover_->RemoveObserver(this); 71 remover_->RemoveObserver(this);
72 origin_runner_->PostTask(FROM_HERE, callback_); 72 origin_runner_->PostTask(FROM_HERE, callback_);
73 origin_runner_->DeleteSoon(FROM_HERE, this); 73 origin_runner_->DeleteSoon(FROM_HERE, this);
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 const JavaParamRef<jstring>& j_email) { 336 const JavaParamRef<jstring>& j_email) {
337 std::string email = base::android::ConvertJavaStringToUTF8(env, j_email); 337 std::string email = base::android::ConvertJavaStringToUTF8(env, j_email);
338 std::string domain = gaia::ExtractDomainName(email); 338 std::string domain = gaia::ExtractDomainName(email);
339 return base::android::ConvertUTF8ToJavaString(env, domain); 339 return base::android::ConvertUTF8ToJavaString(env, domain);
340 } 340 }
341 341
342 // static 342 // static
343 bool SigninManagerAndroid::Register(JNIEnv* env) { 343 bool SigninManagerAndroid::Register(JNIEnv* env) {
344 return RegisterNativesImpl(env); 344 return RegisterNativesImpl(env);
345 } 345 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698