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

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

Issue 12972006: Display user account name in password and passphrase activity prompt. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move it out of hint. Created 7 years, 9 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"
11 #include "base/json/json_writer.h" 11 #include "base/json/json_writer.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/prefs/pref_service.h" 14 #include "base/prefs/pref_service.h"
15 #include "base/time.h" 15 #include "base/time.h"
16 #include "base/utf_string_conversions.h"
16 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/profiles/profile_manager.h" 18 #include "chrome/browser/profiles/profile_manager.h"
18 #include "chrome/browser/signin/signin_manager.h" 19 #include "chrome/browser/signin/signin_manager.h"
19 #include "chrome/browser/signin/signin_manager_factory.h" 20 #include "chrome/browser/signin/signin_manager_factory.h"
20 #include "chrome/browser/signin/token_service.h" 21 #include "chrome/browser/signin/token_service.h"
21 #include "chrome/browser/signin/token_service_factory.h" 22 #include "chrome/browser/signin/token_service_factory.h"
22 #include "chrome/browser/sync/about_sync_util.h" 23 #include "chrome/browser/sync/about_sync_util.h"
23 #include "chrome/browser/sync/profile_sync_service.h" 24 #include "chrome/browser/sync/profile_sync_service.h"
24 #include "chrome/browser/sync/profile_sync_service_factory.h" 25 #include "chrome/browser/sync/profile_sync_service_factory.h"
25 #include "chrome/browser/sync/sync_prefs.h" 26 #include "chrome/browser/sync/sync_prefs.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 JNIEnv* env, jobject) { 377 JNIEnv* env, jobject) {
377 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 378 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
378 base::Time passphrase_time = sync_service_->GetExplicitPassphraseTime(); 379 base::Time passphrase_time = sync_service_->GetExplicitPassphraseTime();
379 string16 passphrase_time_str = base::TimeFormatShortDate(passphrase_time); 380 string16 passphrase_time_str = base::TimeFormatShortDate(passphrase_time);
380 return base::android::ConvertUTF16ToJavaString(env, 381 return base::android::ConvertUTF16ToJavaString(env,
381 l10n_util::GetStringFUTF16(IDS_SYNC_ENTER_PASSPHRASE_BODY_WITH_DATE, 382 l10n_util::GetStringFUTF16(IDS_SYNC_ENTER_PASSPHRASE_BODY_WITH_DATE,
382 passphrase_time_str)); 383 passphrase_time_str));
383 } 384 }
384 385
385 ScopedJavaLocalRef<jstring> 386 ScopedJavaLocalRef<jstring>
387 ProfileSyncServiceAndroid::GetCurrentSignedInAccountText(
388 JNIEnv* env, jobject) {
389 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
390 const std::string& sync_username =
391 SigninManagerFactory::GetForProfile(profile_)->GetAuthenticatedUsername();
392 return base::android::ConvertUTF16ToJavaString(env,
393 l10n_util::GetStringFUTF16(
394 IDS_SYNC_ACCOUNT_SYNCING_TO_USER,
tim (not reviewing) 2013/03/26 01:04:36 indent off (two more spaces)
acleung1 2013/03/26 01:48:48 Done.
395 ASCIIToUTF16(sync_username)));
396 }
397
398 ScopedJavaLocalRef<jstring>
386 ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyText( 399 ProfileSyncServiceAndroid::GetSyncEnterCustomPassphraseBodyText(
387 JNIEnv* env, jobject) { 400 JNIEnv* env, jobject) {
388 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 401 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
389 return ConvertUTF8ToJavaString( 402 return ConvertUTF8ToJavaString(
390 env, l10n_util::GetStringUTF8(IDS_SYNC_ENTER_PASSPHRASE_BODY)); 403 env, l10n_util::GetStringUTF8(IDS_SYNC_ENTER_PASSPHRASE_BODY));
391 } 404 }
392 405
393 jboolean ProfileSyncServiceAndroid::IsSyncKeystoreMigrationDone( 406 jboolean ProfileSyncServiceAndroid::IsSyncKeystoreMigrationDone(
394 JNIEnv* env, jobject) { 407 JNIEnv* env, jobject) {
395 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 408 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 ProfileSyncServiceAndroid* profile_sync_service_android = 551 ProfileSyncServiceAndroid* profile_sync_service_android =
539 new ProfileSyncServiceAndroid(env, obj); 552 new ProfileSyncServiceAndroid(env, obj);
540 profile_sync_service_android->Init(); 553 profile_sync_service_android->Init();
541 return reinterpret_cast<jint>(profile_sync_service_android); 554 return reinterpret_cast<jint>(profile_sync_service_android);
542 } 555 }
543 556
544 // static 557 // static
545 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) { 558 bool ProfileSyncServiceAndroid::Register(JNIEnv* env) {
546 return RegisterNativesImpl(env); 559 return RegisterNativesImpl(env);
547 } 560 }
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