| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; | 54 virtual scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() = 0; |
| 55 // There is no expectations that tab_id is always present. | 55 // There is no expectations that tab_id is always present. |
| 56 virtual bool GetTabId(content::WebContents* web_contents, int* tab_id) = 0; | 56 virtual bool GetTabId(content::WebContents* web_contents, int* tab_id) = 0; |
| 57 virtual bool IsLowEndDevice() = 0; |
| 57 }; | 58 }; |
| 58 void SetDelegate(std::unique_ptr<RecentTabHelper::Delegate> delegate); | 59 void SetDelegate(std::unique_ptr<RecentTabHelper::Delegate> delegate); |
| 59 | 60 |
| 60 // Creates a request to download the current page with a properly filled | 61 // Creates a request to download the current page with a properly filled |
| 61 // |client_id| and valid |request_id| issued by RequestCoordinator from a | 62 // |client_id| and valid |request_id| issued by RequestCoordinator from a |
| 62 // suspended request. This method might be called multiple times for the same | 63 // suspended request. This method might be called multiple times for the same |
| 63 // page at any point after its navigation commits. There are some important | 64 // page at any point after its navigation commits. There are some important |
| 64 // points about how requests are handled: | 65 // points about how requests are handled: |
| 65 // a) While there is an ongoing request, new requests are ignored (no | 66 // a) While there is an ongoing request, new requests are ignored (no |
| 66 // overlapping snapshots). | 67 // overlapping snapshots). |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 SnapshotController::PageQuality::POOR; | 154 SnapshotController::PageQuality::POOR; |
| 154 | 155 |
| 155 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; | 156 base::WeakPtrFactory<RecentTabHelper> weak_ptr_factory_; |
| 156 | 157 |
| 157 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); | 158 DISALLOW_COPY_AND_ASSIGN(RecentTabHelper); |
| 158 }; | 159 }; |
| 159 | 160 |
| 160 } // namespace offline_pages | 161 } // namespace offline_pages |
| 161 | 162 |
| 162 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ | 163 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_RECENT_TAB_HELPER_H_ |
| OLD | NEW |