| 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_RECENT_TAB_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // Test method, overrides the task_runner_ so FastForwardBy() can be used. | 58 // Test method, overrides the task_runner_ so FastForwardBy() can be used. |
| 59 void SetTaskRunnerForTest( | 59 void SetTaskRunnerForTest( |
| 60 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); | 60 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 explicit RecentTabHelper(content::WebContents* web_contents); | 63 explicit RecentTabHelper(content::WebContents* web_contents); |
| 64 friend class content::WebContentsUserData<RecentTabHelper>; | 64 friend class content::WebContentsUserData<RecentTabHelper>; |
| 65 | 65 |
| 66 | 66 |
| 67 void ContinueSnapshotWithIdsToPurge(const std::vector<int64_t>& page_ids); | 67 void ContinueSnapshotWithIdsToPurge(const std::vector<int64_t>& page_ids); |
| 68 void ContinueSnapshotAfterPurge(OfflinePageModel::DeletePageResult result); | 68 void ContinueSnapshotAfterPurge(DeletePageResult result); |
| 69 void SavePageCallback(OfflinePageModel::SavePageResult result, | 69 void SavePageCallback(SavePageResult result, int64_t offline_id); |
| 70 int64_t offline_id); | |
| 71 | 70 |
| 72 void ReportSnapshotCompleted(); | 71 void ReportSnapshotCompleted(); |
| 73 bool IsSamePage() const; | 72 bool IsSamePage() const; |
| 74 ClientId client_id() const; | 73 ClientId client_id() const; |
| 75 | 74 |
| 76 // Page model is a service, no ownership. | 75 // Page model is a service, no ownership. |
| 77 OfflinePageModel* page_model_; | 76 OfflinePageModel* page_model_; |
| 78 | 77 |
| 79 // If true, never make snapshots off the attached WebContents. | 78 // If true, never make snapshots off the attached WebContents. |
| 80 bool never_do_snapshots_; | 79 bool never_do_snapshots_; |
| 81 | 80 |
| 82 // The URL of the page that is currently being snapshotted. Used to check, | 81 // The URL of the page that is currently being snapshotted. Used to check, |
| 83 // during async operations, that WebContents still contains the same page. | 82 // during async operations, that WebContents still contains the same page. |
| 84 GURL snapshot_url_; | 83 GURL snapshot_url_; |
| 85 std::unique_ptr<SnapshotController> snapshot_controller_; | 84 std::unique_ptr<SnapshotController> snapshot_controller_; |
| 86 std::unique_ptr<TestArchiveFactory> test_archive_factory_; | 85 std::unique_ptr<TestArchiveFactory> test_archive_factory_; |
| 87 | 86 |
| 88 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; | 87 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; |
| 89 | 88 |
| 90 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); | 89 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); |
| 91 }; | 90 }; |
| 92 | 91 |
| 93 } // namespace offline_pages | 92 } // namespace offline_pages |
| 94 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ | 93 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
| OLD | NEW |