OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ |
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
9 #include "base/android/jni_weak_ref.h" | 11 #include "base/android/jni_weak_ref.h" |
| 12 #include "base/macros.h" |
10 #include "components/offline_pages/offline_page_model.h" | 13 #include "components/offline_pages/offline_page_model.h" |
11 | 14 |
12 namespace content { | 15 namespace content { |
13 class BrowserContext; | 16 class BrowserContext; |
14 } | 17 } |
15 | 18 |
16 namespace offline_pages { | 19 namespace offline_pages { |
17 namespace android { | 20 namespace android { |
18 | 21 |
19 /** | 22 /** |
20 * Bridge between C++ and Java for exposing native implementation of offline | 23 * Bridge between C++ and Java for exposing native implementation of offline |
21 * pages model in managed code. | 24 * pages model in managed code. |
22 */ | 25 */ |
23 class OfflinePageBridge : public OfflinePageModel::Observer { | 26 class OfflinePageBridge : public OfflinePageModel::Observer { |
24 public: | 27 public: |
25 OfflinePageBridge(JNIEnv* env, | 28 OfflinePageBridge(JNIEnv* env, |
26 jobject obj, | 29 jobject obj, |
27 content::BrowserContext* browser_context); | 30 content::BrowserContext* browser_context); |
28 void Destroy(JNIEnv*, const base::android::JavaParamRef<jobject>&); | 31 void Destroy(JNIEnv*, const base::android::JavaParamRef<jobject>&); |
29 | 32 |
30 // OfflinePageModel::Observer implementation. | 33 // OfflinePageModel::Observer implementation. |
31 void OfflinePageModelLoaded(OfflinePageModel* model) override; | 34 void OfflinePageModelLoaded(OfflinePageModel* model) override; |
32 void OfflinePageModelChanged(OfflinePageModel* model) override; | 35 void OfflinePageModelChanged(OfflinePageModel* model) override; |
33 void OfflinePageDeleted(int64 bookmark_id) override; | 36 void OfflinePageDeleted(int64_t bookmark_id) override; |
34 | 37 |
35 void GetAllPages(JNIEnv* env, | 38 void GetAllPages(JNIEnv* env, |
36 const base::android::JavaParamRef<jobject>& obj, | 39 const base::android::JavaParamRef<jobject>& obj, |
37 const base::android::JavaParamRef<jobject>& j_result_obj); | 40 const base::android::JavaParamRef<jobject>& j_result_obj); |
38 void GetPagesToCleanUp( | 41 void GetPagesToCleanUp( |
39 JNIEnv* env, | 42 JNIEnv* env, |
40 const base::android::JavaParamRef<jobject>& obj, | 43 const base::android::JavaParamRef<jobject>& obj, |
41 const base::android::JavaParamRef<jobject>& j_result_obj); | 44 const base::android::JavaParamRef<jobject>& j_result_obj); |
42 | 45 |
43 base::android::ScopedJavaLocalRef<jobject> GetPageByBookmarkId( | 46 base::android::ScopedJavaLocalRef<jobject> GetPageByBookmarkId( |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 DISALLOW_COPY_AND_ASSIGN(OfflinePageBridge); | 92 DISALLOW_COPY_AND_ASSIGN(OfflinePageBridge); |
90 }; | 93 }; |
91 | 94 |
92 bool RegisterOfflinePageBridge(JNIEnv* env); | 95 bool RegisterOfflinePageBridge(JNIEnv* env); |
93 | 96 |
94 } // namespace android | 97 } // namespace android |
95 } // namespace offline_pages | 98 } // namespace offline_pages |
96 | 99 |
97 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ | 100 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ |
98 | 101 |
OLD | NEW |