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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 // SnapshotController::Client | 44 // SnapshotController::Client |
45 void StartSnapshot() override; | 45 void StartSnapshot() override; |
46 | 46 |
47 // Delegate that is used by RecentTabHelper to get external dependencies. | 47 // Delegate that is used by RecentTabHelper to get external dependencies. |
48 // Default implementation lives in .cc file, while tests provide an override. | 48 // Default implementation lives in .cc file, while tests provide an override. |
49 class Delegate { | 49 class Delegate { |
50 public: | 50 public: |
51 virtual ~Delegate() {} | 51 virtual ~Delegate() {} |
52 virtual std::unique_ptr<OfflinePageArchiver> CreatePageArchiver( | 52 virtual std::unique_ptr<OfflinePageArchiver> CreatePageArchiver( |
53 content::WebContents* web_contents) = 0; | 53 content::WebContents* web_contents) = 0; |
54 virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; | |
55 // There is no expectations that tab_id is always present. | 54 // There is no expectations that tab_id is always present. |
56 virtual bool GetTabId(content::WebContents* web_contents, int* tab_id) = 0; | 55 virtual bool GetTabId(content::WebContents* web_contents, int* tab_id) = 0; |
57 virtual bool IsLowEndDevice() = 0; | 56 virtual bool IsLowEndDevice() = 0; |
58 }; | 57 }; |
59 void SetDelegate(std::unique_ptr<RecentTabHelper::Delegate> delegate); | 58 void SetDelegate(std::unique_ptr<RecentTabHelper::Delegate> delegate); |
60 | 59 |
61 // Creates a request to download the current page with a properly filled | 60 // Creates a request to download the current page with a properly filled |
62 // |client_id| and valid |request_id| issued by RequestCoordinator from a | 61 // |client_id| and valid |request_id| issued by RequestCoordinator from a |
63 // suspended request. This method might be called multiple times for the same | 62 // suspended request. This method might be called multiple times for the same |
64 // page at any point after its navigation commits. There are some important | 63 // page at any point after its navigation commits. There are some important |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 bool last_n_listen_to_tab_hidden_ = false; | 144 bool last_n_listen_to_tab_hidden_ = false; |
146 | 145 |
147 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; | 146 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; |
148 | 147 |
149 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); | 148 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); |
150 }; | 149 }; |
151 | 150 |
152 } // namespace offline_pages | 151 } // namespace offline_pages |
153 | 152 |
154 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ | 153 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
OLD | NEW |