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 "content/public/browser/browser_context.h" |
| 11 #include "jni/OfflinePageBridge_jni.h" |
| 12 |
| 13 namespace offline_pages { |
| 14 namespace android { |
| 15 |
| 16 OfflinePageBridge::OfflinePageBridge(JNIEnv* env, |
| 17 jobject obj, |
| 18 content::BrowserContext* browser_context) |
| 19 : weak_java_ref_(env, obj), |
| 20 offline_page_model_(nullptr), |
| 21 browser_context_(browser_context) { |
| 22 // TODO(fgorski): Pull offline pages model from the factory once it is |
| 23 // available. |
| 24 } |
| 25 |
| 26 void OfflinePageBridge::Destroy(JNIEnv*, jobject) { |
| 27 delete this; |
| 28 } |
| 29 |
| 30 static jlong Init(JNIEnv* env, jobject obj, jobject j_profile) { |
| 31 return reinterpret_cast<jlong>(new OfflinePageBridge( |
| 32 env, obj, ProfileAndroid::FromProfileAndroid(j_profile))); |
| 33 } |
| 34 |
| 35 bool RegisterOfflinePageBridge(JNIEnv* env) { |
| 36 return RegisterNativesImpl(env); |
| 37 } |
| 38 |
| 39 } // namespace android |
| 40 } // namespace offline_pages |
OLD | NEW |