OLD | NEW |
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/profiles/profile_android.h" | 5 #include "chrome/browser/profiles/profile_android.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/profiles/profile_destroyer.h" | 9 #include "chrome/browser/profiles/profile_destroyer.h" |
10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 ProfileAndroid::ProfileAndroid(Profile* profile) | 113 ProfileAndroid::ProfileAndroid(Profile* profile) |
114 : profile_(profile) { | 114 : profile_(profile) { |
115 JNIEnv* env = AttachCurrentThread(); | 115 JNIEnv* env = AttachCurrentThread(); |
116 base::android::ScopedJavaLocalRef<jobject> jprofile = | 116 base::android::ScopedJavaLocalRef<jobject> jprofile = |
117 Java_Profile_create(env, reinterpret_cast<intptr_t>(this)); | 117 Java_Profile_create(env, reinterpret_cast<intptr_t>(this)); |
118 obj_.Reset(env, jprofile.obj()); | 118 obj_.Reset(env, jprofile.obj()); |
119 } | 119 } |
120 | 120 |
121 ProfileAndroid::~ProfileAndroid() { | 121 ProfileAndroid::~ProfileAndroid() { |
122 Java_Profile_onNativeDestroyed(AttachCurrentThread(), obj_.obj()); | 122 Java_Profile_onNativeDestroyed(AttachCurrentThread(), obj_); |
123 } | 123 } |
124 | 124 |
125 base::android::ScopedJavaLocalRef<jobject> ProfileAndroid::GetJavaObject() { | 125 base::android::ScopedJavaLocalRef<jobject> ProfileAndroid::GetJavaObject() { |
126 return base::android::ScopedJavaLocalRef<jobject>(obj_); | 126 return base::android::ScopedJavaLocalRef<jobject>(obj_); |
127 } | 127 } |
OLD | NEW |