[sql] Remove _HAS_EXCEPTIONS=0 from build info.
[chromium-blink-merge.git] / chrome / browser / android / offline_pages / offline_page_bridge.h
blob0da82bb043287f09b3cac062989c08f57525212b
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"
11 namespace base {
12 class FilePath;
15 namespace content {
16 class BrowserContext;
19 namespace offline_pages {
21 class OfflinePageModel;
23 namespace android {
25 /**
26 * Bridge between C++ and Java for exposing native implementation of offline
27 * pages model in managed code.
29 class OfflinePageBridge {
30 public:
31 OfflinePageBridge(JNIEnv* env,
32 jobject obj,
33 content::BrowserContext* browser_context);
34 void Destroy(JNIEnv*, jobject);
36 void LoadAllPages(JNIEnv* env,
37 jobject obj,
38 jobject j_callback_obj,
39 jobject j_result_obj);
41 void SavePage(JNIEnv* env,
42 jobject obj,
43 jobject j_callback_obj,
44 jobject j_web_contents,
45 jlong bookmark_id);
47 private:
48 base::FilePath GetDownloadsPath() const;
50 JavaObjectWeakGlobalRef weak_java_ref_;
51 // Not owned.
52 OfflinePageModel* offline_page_model_;
53 // Not owned.
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_