| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_DOWNLOADS_OFFLINE_PAGE_DOWNLOAD_BRI
DGE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_DOWNLOADS_OFFLINE_PAGE_DOWNLOAD_BRI
DGE_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_DOWNLOADS_OFFLINE_PAGE_DOWNLOAD_BRI
DGE_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_DOWNLOADS_OFFLINE_PAGE_DOWNLOAD_BRI
DGE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 11 #include "base/android/jni_weak_ref.h" | 11 #include "base/android/jni_weak_ref.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/weak_ptr.h" | |
| 14 #include "base/supports_user_data.h" | 13 #include "base/supports_user_data.h" |
| 15 #include "components/offline_pages/downloads/download_ui_adapter.h" | 14 #include "components/offline_pages/downloads/download_ui_adapter.h" |
| 16 | 15 |
| 17 namespace content { | 16 namespace content { |
| 18 class BrowserContext; | 17 class BrowserContext; |
| 19 } | 18 } |
| 20 | 19 |
| 21 namespace offline_pages { | 20 namespace offline_pages { |
| 22 namespace android { | 21 namespace android { |
| 23 | 22 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 const base::android::JavaParamRef<jobject>& obj, | 62 const base::android::JavaParamRef<jobject>& obj, |
| 64 const base::android::JavaParamRef<jobject>& j_tab); | 63 const base::android::JavaParamRef<jobject>& j_tab); |
| 65 | 64 |
| 66 // DownloadUIAdapter::Observer implementation. | 65 // DownloadUIAdapter::Observer implementation. |
| 67 void ItemsLoaded() override; | 66 void ItemsLoaded() override; |
| 68 void ItemAdded(const DownloadUIItem& item) override; | 67 void ItemAdded(const DownloadUIItem& item) override; |
| 69 void ItemUpdated(const DownloadUIItem& item) override; | 68 void ItemUpdated(const DownloadUIItem& item) override; |
| 70 void ItemDeleted(const std::string& guid) override; | 69 void ItemDeleted(const std::string& guid) override; |
| 71 | 70 |
| 72 private: | 71 private: |
| 73 void SavePageCallback(const DownloadUIItem& item, | 72 static void SavePageCallback(const DownloadUIItem& item, |
| 74 OfflinePageModel::SavePageResult result, | 73 OfflinePageModel::SavePageResult result, |
| 75 int64_t offline_id); | 74 int64_t offline_id); |
| 76 | 75 |
| 77 JavaObjectWeakGlobalRef weak_java_ref_; | 76 JavaObjectWeakGlobalRef weak_java_ref_; |
| 78 // Not owned. | 77 // Not owned. |
| 79 DownloadUIAdapter* download_ui_adapter_; | 78 DownloadUIAdapter* download_ui_adapter_; |
| 80 | 79 |
| 81 base::WeakPtrFactory<OfflinePageDownloadBridge> weak_ptr_factory_; | |
| 82 DISALLOW_COPY_AND_ASSIGN(OfflinePageDownloadBridge); | 80 DISALLOW_COPY_AND_ASSIGN(OfflinePageDownloadBridge); |
| 83 }; | 81 }; |
| 84 | 82 |
| 85 } // namespace android | 83 } // namespace android |
| 86 } // namespace offline_pages | 84 } // namespace offline_pages |
| 87 | 85 |
| 88 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_DOWNLOADS_OFFLINE_PAGE_DOWNLOAD_
BRIDGE_H_ | 86 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_DOWNLOADS_OFFLINE_PAGE_DOWNLOAD_
BRIDGE_H_ |
| OLD | NEW |