Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: chrome/browser/android/offline_pages/recent_tab_helper.h

Issue 2773273002: Last_n: do not save snapshot of custom tabs. (Closed)
Patch Set: Renamed method; added custom tab checks to tests. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // Delegate that is used by RecentTabHelper to get external dependencies. 52 // Delegate that is used by RecentTabHelper to get external dependencies.
53 // Default implementation lives in .cc file, while tests provide an override. 53 // Default implementation lives in .cc file, while tests provide an override.
54 class Delegate { 54 class Delegate {
55 public: 55 public:
56 virtual ~Delegate() {} 56 virtual ~Delegate() {}
57 virtual std::unique_ptr<OfflinePageArchiver> CreatePageArchiver( 57 virtual std::unique_ptr<OfflinePageArchiver> CreatePageArchiver(
58 content::WebContents* web_contents) = 0; 58 content::WebContents* web_contents) = 0;
59 // There is no expectations that tab_id is always present. 59 // There is no expectations that tab_id is always present.
60 virtual bool GetTabId(content::WebContents* web_contents, int* tab_id) = 0; 60 virtual bool GetTabId(content::WebContents* web_contents, int* tab_id) = 0;
61 virtual bool IsLowEndDevice() = 0; 61 virtual bool IsLowEndDevice() = 0;
62 virtual bool IsCustomTab(content::WebContents* web_contents) = 0;
62 }; 63 };
63 void SetDelegate(std::unique_ptr<RecentTabHelper::Delegate> delegate); 64 void SetDelegate(std::unique_ptr<RecentTabHelper::Delegate> delegate);
64 65
65 // Creates a request to download the current page with a properly filled 66 // Creates a request to download the current page with a properly filled
66 // |client_id| and valid |request_id| issued by RequestCoordinator from a 67 // |client_id| and valid |request_id| issued by RequestCoordinator from a
67 // suspended request. This method might be called multiple times for the same 68 // suspended request. This method might be called multiple times for the same
68 // page at any point after its navigation commits. There are some important 69 // page at any point after its navigation commits. There are some important
69 // points about how requests are handled: 70 // points about how requests are handled:
70 // a) While there is an ongoing request, new requests are ignored (no 71 // a) While there is an ongoing request, new requests are ignored (no
71 // overlapping snapshots). 72 // overlapping snapshots).
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 bool tab_is_closing_ = false; 154 bool tab_is_closing_ = false;
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_
OLDNEW
« no previous file with comments | « chrome/browser/android/offline_pages/offline_page_utils.cc ('k') | chrome/browser/android/offline_pages/recent_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698