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

Side by Side Diff: chrome/browser/sync/profile_sync_service_android.cc

Issue 16105012: Unrevert "[Sync] Split GetPreferredTypes into GetActiveType..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjust mock Created 7 years, 6 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 | Annotate | Revision Log
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 "chrome/browser/sync/profile_sync_service_android.h" 5 #include "chrome/browser/sync/profile_sync_service_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/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 JNIEnv* env, jobject) { 457 JNIEnv* env, jobject) {
458 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 458 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
459 syncer::SyncStatus status; 459 syncer::SyncStatus status;
460 bool is_status_valid = sync_service_->QueryDetailedSyncStatus(&status); 460 bool is_status_valid = sync_service_->QueryDetailedSyncStatus(&status);
461 return is_status_valid && !status.keystore_migration_time.is_null(); 461 return is_status_valid && !status.keystore_migration_time.is_null();
462 } 462 }
463 463
464 jlong ProfileSyncServiceAndroid::GetEnabledDataTypes(JNIEnv* env, 464 jlong ProfileSyncServiceAndroid::GetEnabledDataTypes(JNIEnv* env,
465 jobject obj) { 465 jobject obj) {
466 jlong model_type_selection = 0; 466 jlong model_type_selection = 0;
467 syncer::ModelTypeSet types = sync_service_->GetPreferredDataTypes(); 467 syncer::ModelTypeSet types = sync_service_->GetActiveDataTypes();
468 types.PutAll(syncer::ControlTypes()); 468 types.PutAll(syncer::ControlTypes());
469 if (types.Has(syncer::BOOKMARKS)) { 469 if (types.Has(syncer::BOOKMARKS)) {
470 model_type_selection |= BOOKMARK; 470 model_type_selection |= BOOKMARK;
471 } 471 }
472 if (types.Has(syncer::AUTOFILL)) { 472 if (types.Has(syncer::AUTOFILL)) {
473 model_type_selection |= AUTOFILL; 473 model_type_selection |= AUTOFILL;
474 } 474 }
475 if (types.Has(syncer::AUTOFILL_PROFILE)) { 475 if (types.Has(syncer::AUTOFILL_PROFILE)) {
476 model_type_selection |= AUTOFILL_PROFILE; 476 model_type_selection |= AUTOFILL_PROFILE;
477 } 477 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 ProfileSyncServiceAndroid* profile_sync_service_android = 628 ProfileSyncServiceAndroid* profile_sync_service_android =
629 new ProfileSyncServiceAndroid(env, obj); 629 new ProfileSyncServiceAndroid(env, obj);
630 profile_sync_service_android->Init(); 630 profile_sync_service_android->Init();
631 return reinterpret_cast<jint>(profile_sync_service_android); 631 return reinterpret_cast<jint>(profile_sync_service_android);
632 } 632 }
633 633
634 // static 634 // static
635 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { 635 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) {
636 return RegisterNativesImpl(env); 636 return RegisterNativesImpl(env);
637 } 637 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/profile_sync_service_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698