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.
5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_
8 #include "base/android/jni_android.h"
9 #include "base/android/jni_weak_ref.h"
19 namespace offline_pages
{
21 class OfflinePageModel
;
26 * Bridge between C++ and Java for exposing native implementation of offline
27 * pages model in managed code.
29 class OfflinePageBridge
{
31 OfflinePageBridge(JNIEnv
* env
,
33 content::BrowserContext
* browser_context
);
34 void Destroy(JNIEnv
*, jobject
);
36 void LoadAllPages(JNIEnv
* env
,
38 jobject j_callback_obj
,
39 jobject j_result_obj
);
41 void SavePage(JNIEnv
* env
,
43 jobject j_callback_obj
,
44 jobject j_web_contents
,
48 base::FilePath
GetDownloadsPath() const;
50 JavaObjectWeakGlobalRef weak_java_ref_
;
52 OfflinePageModel
* offline_page_model_
;
54 content::BrowserContext
* browser_context_
;
55 DISALLOW_COPY_AND_ASSIGN(OfflinePageBridge
);
58 bool RegisterOfflinePageBridge(JNIEnv
* env
);
60 } // namespace android
61 } // namespace offline_pages
63 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_