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

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

Issue 551843003: Persist Directory to disk when the app is backgrounded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits. Created 6 years, 2 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
« no previous file with comments | « chrome/browser/sync/profile_sync_service_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 134
135 void ProfileSyncServiceAndroid::SignOutSync(JNIEnv* env, jobject) { 135 void ProfileSyncServiceAndroid::SignOutSync(JNIEnv* env, jobject) {
136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
137 DCHECK(profile_); 137 DCHECK(profile_);
138 sync_service_->DisableForUser(); 138 sync_service_->DisableForUser();
139 139
140 // Need to clear suppress start flag manually 140 // Need to clear suppress start flag manually
141 sync_prefs_->SetStartSuppressed(false); 141 sync_prefs_->SetStartSuppressed(false);
142 } 142 }
143 143
144 void ProfileSyncServiceAndroid::FlushDirectory(JNIEnv* env, jobject) {
145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
146 sync_service_->FlushDirectory();
147 }
148
144 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::QuerySyncStatusSummary( 149 ScopedJavaLocalRef<jstring> ProfileSyncServiceAndroid::QuerySyncStatusSummary(
145 JNIEnv* env, jobject) { 150 JNIEnv* env, jobject) {
146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 151 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
147 DCHECK(profile_); 152 DCHECK(profile_);
148 std::string status(sync_service_->QuerySyncStatusSummaryString()); 153 std::string status(sync_service_->QuerySyncStatusSummaryString());
149 return ConvertUTF8ToJavaString(env, status); 154 return ConvertUTF8ToJavaString(env, status);
150 } 155 }
151 156
152 jboolean ProfileSyncServiceAndroid::SetSyncSessionsId( 157 jboolean ProfileSyncServiceAndroid::SetSyncSessionsId(
153 JNIEnv* env, jobject obj, jstring tag) { 158 JNIEnv* env, jobject obj, jstring tag) {
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 ProfileSyncServiceAndroid* profile_sync_service_android = 481 ProfileSyncServiceAndroid* profile_sync_service_android =
477 new ProfileSyncServiceAndroid(env, obj); 482 new ProfileSyncServiceAndroid(env, obj);
478 profile_sync_service_android->Init(); 483 profile_sync_service_android->Init();
479 return reinterpret_cast<intptr_t>(profile_sync_service_android); 484 return reinterpret_cast<intptr_t>(profile_sync_service_android);
480 } 485 }
481 486
482 // static 487 // static
483 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { 488 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) {
484 return RegisterNativesImpl(env); 489 return RegisterNativesImpl(env);
485 } 490 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698