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

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

Issue 2279713002: Make PassphraseType a "enum class" instead of "enum". (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix java Created 4 years, 3 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 | « no previous file | chrome/browser/ui/webui/options/sync_setup_handler.cc » ('j') | 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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 const JavaParamRef<jobject>& obj) { 283 const JavaParamRef<jobject>& obj) {
284 std::string key = sync_service_->GetCustomPassphraseKey(); 284 std::string key = sync_service_->GetCustomPassphraseKey();
285 return base::android::ToJavaByteArray( 285 return base::android::ToJavaByteArray(
286 env, reinterpret_cast<const uint8_t*>(key.data()), key.size()); 286 env, reinterpret_cast<const uint8_t*>(key.data()), key.size());
287 } 287 }
288 288
289 jint ProfileSyncServiceAndroid::GetPassphraseType( 289 jint ProfileSyncServiceAndroid::GetPassphraseType(
290 JNIEnv* env, 290 JNIEnv* env,
291 const JavaParamRef<jobject>&) { 291 const JavaParamRef<jobject>&) {
292 DCHECK_CURRENTLY_ON(BrowserThread::UI); 292 DCHECK_CURRENTLY_ON(BrowserThread::UI);
293 return sync_service_->GetPassphraseType(); 293 return static_cast<unsigned>(sync_service_->GetPassphraseType());
294 } 294 }
295 295
296 void ProfileSyncServiceAndroid::SetEncryptionPassphrase( 296 void ProfileSyncServiceAndroid::SetEncryptionPassphrase(
297 JNIEnv* env, 297 JNIEnv* env,
298 const JavaParamRef<jobject>& obj, 298 const JavaParamRef<jobject>& obj,
299 const JavaParamRef<jstring>& passphrase) { 299 const JavaParamRef<jstring>& passphrase) {
300 DCHECK_CURRENTLY_ON(BrowserThread::UI); 300 DCHECK_CURRENTLY_ON(BrowserThread::UI);
301 std::string key = ConvertJavaStringToUTF8(env, passphrase); 301 std::string key = ConvertJavaStringToUTF8(env, passphrase);
302 sync_service_->SetEncryptionPassphrase(key, ProfileSyncService::EXPLICIT); 302 sync_service_->SetEncryptionPassphrase(key, ProfileSyncService::EXPLICIT);
303 } 303 }
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { 513 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
514 ProfileSyncServiceAndroid* profile_sync_service_android = 514 ProfileSyncServiceAndroid* profile_sync_service_android =
515 new ProfileSyncServiceAndroid(env, obj); 515 new ProfileSyncServiceAndroid(env, obj);
516 if (profile_sync_service_android->Init()) { 516 if (profile_sync_service_android->Init()) {
517 return reinterpret_cast<intptr_t>(profile_sync_service_android); 517 return reinterpret_cast<intptr_t>(profile_sync_service_android);
518 } else { 518 } else {
519 delete profile_sync_service_android; 519 delete profile_sync_service_android;
520 return 0; 520 return 0;
521 } 521 }
522 } 522 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698