OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/android/offline_pages/offline_page_bridge.h" |
| 6 |
| 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/profiles/profile_android.h" |
| 9 #include "components/offline_pages/offline_page_model.h" |
| 10 #include "jni/OfflinePageBridge_jni.h" |
| 11 |
| 12 namespace offline_pages { |
| 13 namespace android { |
| 14 |
| 15 OfflinePageBridge::OfflinePageBridge(JNIEnv* env, jobject obj, Profile* profile) |
| 16 : weak_java_ref_(env, obj), |
| 17 offline_page_model_(nullptr), |
| 18 profile_(profile) { |
| 19 // TODO(fgorski): Pull offline pages model from the factory once it is |
| 20 // available. |
| 21 } |
| 22 |
| 23 void OfflinePageBridge::Destroy(JNIEnv*, jobject) { |
| 24 delete this; |
| 25 } |
| 26 |
| 27 static jlong Init(JNIEnv* env, jobject obj, jobject j_profile) { |
| 28 return reinterpret_cast<jlong>(new OfflinePageBridge( |
| 29 env, obj, ProfileAndroid::FromProfileAndroid(j_profile))); |
| 30 } |
| 31 |
| 32 bool RegisterOfflinePageBridge(JNIEnv* env) { |
| 33 return RegisterNativesImpl(env); |
| 34 } |
| 35 |
| 36 } // namespace android |
| 37 } // namespace offline_pages |
OLD | NEW |