| 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_BACKGROUND_LOADER_OFFLINER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/android/application_status_listener.h" | 10 #include "base/android/application_status_listener.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public: | 31 public: |
| 32 BackgroundLoaderOffliner(content::BrowserContext* browser_context, | 32 BackgroundLoaderOffliner(content::BrowserContext* browser_context, |
| 33 const OfflinerPolicy* policy, | 33 const OfflinerPolicy* policy, |
| 34 OfflinePageModel* offline_page_model); | 34 OfflinePageModel* offline_page_model); |
| 35 ~BackgroundLoaderOffliner() override; | 35 ~BackgroundLoaderOffliner() override; |
| 36 | 36 |
| 37 // Offliner implementation. | 37 // Offliner implementation. |
| 38 bool LoadAndSave(const SavePageRequest& request, | 38 bool LoadAndSave(const SavePageRequest& request, |
| 39 const CompletionCallback& callback) override; | 39 const CompletionCallback& callback) override; |
| 40 void Cancel() override; | 40 void Cancel() override; |
| 41 bool HandleTimeout(const SavePageRequest& request) override; |
| 41 | 42 |
| 42 // WebContentsObserver implementation. | 43 // WebContentsObserver implementation. |
| 43 void DidStopLoading() override; | 44 void DidStopLoading() override; |
| 44 void RenderProcessGone(base::TerminationStatus status) override; | 45 void RenderProcessGone(base::TerminationStatus status) override; |
| 45 void WebContentsDestroyed() override; | 46 void WebContentsDestroyed() override; |
| 46 | 47 |
| 47 protected: | 48 protected: |
| 48 // Called to reset internal loader and observer state. | 49 // Called to reset internal loader and observer state. |
| 49 virtual void ResetState(); | 50 virtual void ResetState(); |
| 50 | 51 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 75 bool is_low_end_device_; | 76 bool is_low_end_device_; |
| 76 // Save state. | 77 // Save state. |
| 77 SaveState save_state_; | 78 SaveState save_state_; |
| 78 | 79 |
| 79 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; | 80 base::WeakPtrFactory<BackgroundLoaderOffliner> weak_ptr_factory_; |
| 80 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); | 81 DISALLOW_COPY_AND_ASSIGN(BackgroundLoaderOffliner); |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 } // namespace offline_pages | 84 } // namespace offline_pages |
| 84 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ | 85 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_BACKGROUND_LOADER_OFFLINER_H_ |
| OLD | NEW |