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

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

Issue 1961083002: Updates to PrerenderingOffliner and PrerenderingLoader interfaces to push PrerenderManager knowledge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the unnecessary const on enum accessor as it made a trybot unhappy. Created 4 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/prerendering_loader.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PRERENDERING_LOADER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "components/offline_pages/background/offliner.h" 9 #include "components/offline_pages/background/offliner.h"
10 10
11 class GURL; 11 class GURL;
12 class PrerenderManager;
13 12
14 namespace content { 13 namespace content {
14 class BrowserContext;
15 class WebContents; 15 class WebContents;
16 class SessionStorageNamespace; 16 class SessionStorageNamespace;
17 } // namespace content 17 } // namespace content
18 18
19 namespace gfx { 19 namespace gfx {
20 class Size; 20 class Size;
21 } // namespace gfx 21 } // namespace gfx
22 22
23 namespace offline_pages { 23 namespace offline_pages {
24 24
25 // A client-side page loader that integrates with the PrerenderManager to do 25 // A client-side page loader that integrates with the PrerenderManager to do
26 // the page loading in the background. 26 // the page loading in the background.
27 class PrerenderingLoader { 27 class PrerenderingLoader {
28 public: 28 public:
29 // Reports status of a load page request with loaded contents if available. 29 // Reports status of a load page request with loaded contents if available.
30 typedef base::Callback<void(Offliner::CompletionStatus, 30 typedef base::Callback<void(Offliner::CompletionStatus,
31 content::WebContents*)> 31 content::WebContents*)>
32 LoadPageCallback; 32 LoadPageCallback;
33 33
34 explicit PrerenderingLoader(PrerenderManager* prerender_manager); 34 explicit PrerenderingLoader(content::BrowserContext* browser_context);
35 ~PrerenderingLoader(); 35 virtual ~PrerenderingLoader();
36 36
37 // Loads a page in the background if possible and returns whether the 37 // Loads a page in the background if possible and returns whether the
38 // request was accepted. If so, the LoadPageCallback will be informed 38 // request was accepted. If so, the LoadPageCallback will be informed
39 // of status. Only one load request may exist as a time. If a previous 39 // of status. Only one load request may exist as a time. If a previous
40 // request is still in progress it must be canceled before a new 40 // request is still in progress it must be canceled before a new
41 // request will be accepted. 41 // request will be accepted.
42 bool LoadPage(const GURL& url, 42 virtual bool LoadPage(const GURL& url, const LoadPageCallback& callback);
43 content::SessionStorageNamespace* session_storage_namespace,
44 const gfx::Size& size,
45 const LoadPageCallback& callback);
46 43
47 // Stops (completes or cancels) the load request. Must be called when 44 // Stops (completes or cancels) the load request. Must be called when
48 // LoadPageCallback is done with consuming the contents. 45 // LoadPageCallback is done with consuming the contents.
49 // This loader should also be responsible for stopping offline 46 // This loader should also be responsible for stopping offline
50 // prerenders when Chrome is transitioned to foreground. 47 // prerenders when Chrome is transitioned to foreground.
51 void StopLoading(); 48 virtual void StopLoading();
52 }; 49 };
53 50
54 } // namespace offline_pages 51 } // namespace offline_pages
55 52
56 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ 53 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/prerendering_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698