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 "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_weak_ref.h" | 9 #include "base/android/jni_weak_ref.h" |
10 #include "components/offline_pages/offline_page_model.h" | 10 #include "components/offline_pages/offline_page_model.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 class BrowserContext; | 13 class BrowserContext; |
14 } | 14 } |
15 | 15 |
16 namespace offline_pages { | 16 namespace offline_pages { |
17 namespace android { | 17 namespace android { |
18 | 18 |
19 /** | 19 /** |
20 * Bridge between C++ and Java for exposing native implementation of offline | 20 * Bridge between C++ and Java for exposing native implementation of offline |
21 * pages model in managed code. | 21 * pages model in managed code. |
22 */ | 22 */ |
23 class OfflinePageBridge : public OfflinePageModel::Observer { | 23 class OfflinePageBridge : public OfflinePageModel::Observer { |
24 public: | 24 public: |
25 // Returns true if |url| might points to an offline page. | |
26 static bool MightBeOfflineURL(const GURL& url); | |
27 | |
28 OfflinePageBridge(JNIEnv* env, | 25 OfflinePageBridge(JNIEnv* env, |
29 jobject obj, | 26 jobject obj, |
30 content::BrowserContext* browser_context); | 27 content::BrowserContext* browser_context); |
31 void Destroy(JNIEnv*, const base::android::JavaParamRef<jobject>&); | 28 void Destroy(JNIEnv*, const base::android::JavaParamRef<jobject>&); |
32 | 29 |
33 // OfflinePageModel::Observer implementation. | 30 // OfflinePageModel::Observer implementation. |
34 void OfflinePageModelLoaded(OfflinePageModel* model) override; | 31 void OfflinePageModelLoaded(OfflinePageModel* model) override; |
35 void OfflinePageModelChanged(OfflinePageModel* model) override; | 32 void OfflinePageModelChanged(OfflinePageModel* model) override; |
36 void OfflinePageDeleted(int64 bookmark_id) override; | 33 void OfflinePageDeleted(int64 bookmark_id) override; |
37 | 34 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 DISALLOW_COPY_AND_ASSIGN(OfflinePageBridge); | 89 DISALLOW_COPY_AND_ASSIGN(OfflinePageBridge); |
93 }; | 90 }; |
94 | 91 |
95 bool RegisterOfflinePageBridge(JNIEnv* env); | 92 bool RegisterOfflinePageBridge(JNIEnv* env); |
96 | 93 |
97 } // namespace android | 94 } // namespace android |
98 } // namespace offline_pages | 95 } // namespace offline_pages |
99 | 96 |
100 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ | 97 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_OFFLINE_PAGE_BRIDGE_H_ |
101 | 98 |
OLD | NEW |