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 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ |
| 7 |
| 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_weak_ref.h" |
| 10 |
| 11 namespace content { |
| 12 class BrowserContext; |
| 13 } |
| 14 |
| 15 namespace offline_pages { |
| 16 |
| 17 class OfflinePageModel; |
| 18 |
| 19 namespace android { |
| 20 |
| 21 /** |
| 22 * Bridge between C++ and Java for exposing native implementation of offline |
| 23 * pages model in managed code. |
| 24 */ |
| 25 class OfflinePageBridge { |
| 26 public: |
| 27 OfflinePageBridge(JNIEnv* env, |
| 28 jobject obj, |
| 29 content::BrowserContext* browser_context); |
| 30 void Destroy(JNIEnv*, jobject); |
| 31 |
| 32 private: |
| 33 |
| 34 JavaObjectWeakGlobalRef weak_java_ref_; |
| 35 // Not owned. |
| 36 OfflinePageModel* offline_page_model_; |
| 37 // Not owned. |
| 38 content::BrowserContext* browser_context_; |
| 39 DISALLOW_COPY_AND_ASSIGN(OfflinePageBridge); |
| 40 }; |
| 41 |
| 42 bool RegisterOfflinePageBridge(JNIEnv* env); |
| 43 |
| 44 } // namespace android |
| 45 } // namespace offline_pages |
| 46 |
| 47 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ |
| 48 |
OLD | NEW |