| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 package org.chromium.chrome.browser.profiles; | 5 package org.chromium.chrome.browser.profiles; |
| 6 | 6 |
| 7 import org.chromium.base.CalledByNative; | 7 import org.chromium.base.CalledByNative; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Wrapper that allows passing a Profile reference around in the Java layer. | 10 * Wrapper that allows passing a Profile reference around in the Java layer. |
| 11 */ | 11 */ |
| 12 public class Profile { | 12 public class Profile { |
| 13 | 13 |
| 14 private int mNativeProfileAndroid; | 14 private long mNativeProfileAndroid; |
| 15 | 15 |
| 16 private Profile(int nativeProfileAndroid) { | 16 private Profile(long nativeProfileAndroid) { |
| 17 mNativeProfileAndroid = nativeProfileAndroid; | 17 mNativeProfileAndroid = nativeProfileAndroid; |
| 18 } | 18 } |
| 19 | 19 |
| 20 public static Profile getLastUsedProfile() { | 20 public static Profile getLastUsedProfile() { |
| 21 return (Profile) nativeGetLastUsedProfile(); | 21 return (Profile) nativeGetLastUsedProfile(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 @CalledByNative | 24 @CalledByNative |
| 25 private static Profile create(int nativeProfileAndroid) { | 25 private static Profile create(long nativeProfileAndroid) { |
| 26 return new Profile(nativeProfileAndroid); | 26 return new Profile(nativeProfileAndroid); |
| 27 } | 27 } |
| 28 | 28 |
| 29 @CalledByNative | 29 @CalledByNative |
| 30 private void destroy() { | 30 private void destroy() { |
| 31 mNativeProfileAndroid = 0; | 31 mNativeProfileAndroid = 0; |
| 32 } | 32 } |
| 33 | 33 |
| 34 @CalledByNative | 34 @CalledByNative |
| 35 private int getNativePointer() { | 35 private long getNativePointer() { |
| 36 return mNativeProfileAndroid; | 36 return mNativeProfileAndroid; |
| 37 } | 37 } |
| 38 | 38 |
| 39 private static native Object nativeGetLastUsedProfile(); | 39 private static native Object nativeGetLastUsedProfile(); |
| 40 } | 40 } |
| OLD | NEW |