| 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 25 matching lines...) Expand all Loading... |
| 36 // content::WebContentsObserver | 36 // content::WebContentsObserver |
| 37 void DidFinishNavigation( | 37 void DidFinishNavigation( |
| 38 content::NavigationHandle* navigation_handle) override; | 38 content::NavigationHandle* navigation_handle) override; |
| 39 void DocumentAvailableInMainFrame() override; | 39 void DocumentAvailableInMainFrame() override; |
| 40 void DocumentOnLoadCompletedInMainFrame() override; | 40 void DocumentOnLoadCompletedInMainFrame() override; |
| 41 | 41 |
| 42 // SnapshotController::Client | 42 // SnapshotController::Client |
| 43 void StartSnapshot() override; | 43 void StartSnapshot() override; |
| 44 | 44 |
| 45 // Test support. | 45 // Test support. |
| 46 // A factory that supplies the instances of an OfflienPageArchiver. | 46 // A factory that supplies the instances of an OfflinePageArchiver. |
| 47 // This is used for testing, where we want to use a specific mock. | 47 // This is used for testing, where we want to use a specific mock. |
| 48 class TestArchiveFactory { | 48 class TestArchiveFactory { |
| 49 public: | 49 public: |
| 50 virtual ~TestArchiveFactory() {} | 50 virtual ~TestArchiveFactory() {} |
| 51 virtual std::unique_ptr<OfflinePageArchiver> CreateArchiver( | 51 virtual std::unique_ptr<OfflinePageArchiver> CreateArchiver( |
| 52 content::WebContents* web_contents) = 0; | 52 content::WebContents* web_contents) = 0; |
| 53 }; | 53 }; |
| 54 // Test method, overrides the normally used MHTML Archivers with a test | 54 // Test method, overrides the normally used MHTML Archivers with a test |
| 55 // mocks created by specified function. | 55 // mocks created by specified function. |
| 56 void SetArchiveFactoryForTest( | 56 void SetArchiveFactoryForTest( |
| (...skipping 28 matching lines...) Expand all Loading... |
| 85 std::unique_ptr<SnapshotController> snapshot_controller_; | 85 std::unique_ptr<SnapshotController> snapshot_controller_; |
| 86 std::unique_ptr<TestArchiveFactory> test_archive_factory_; | 86 std::unique_ptr<TestArchiveFactory> test_archive_factory_; |
| 87 | 87 |
| 88 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; | 88 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; |
| 89 | 89 |
| 90 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); | 90 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 } // namespace offline_pages | 93 } // namespace offline_pages |
| 94 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ | 94 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
| OLD | NEW |