OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ | |
6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ | |
7 | |
8 #include "base/callback.h" | |
9 #include "components/offline_pages/background/offliner.h" | |
10 | |
11 class GURL; | |
12 class PrerenderManager; | |
13 class Profile; | |
14 | |
15 namespace content { | |
16 class WebContents; | |
17 class SessionStorageNamespace; | |
18 } // namespace content | |
19 | |
20 namespace gfx { | |
21 class Size; | |
22 } // namespace gfx | |
23 | |
24 namespace offline_pages { | |
25 | |
26 // A client-side page loader that integrates with the PrerenderManager to do | |
27 // the page loading in the background. | |
28 class PrerenderingLoader { | |
29 public: | |
30 typedef base::Callback<void( | |
31 Offliner::CompletionStatus, | |
32 content::WebContents*)> LoadPageCallback; | |
33 | |
34 explicit PrerenderingLoader(Profile* profile); | |
35 ~PrerenderingLoader(); | |
36 | |
37 bool LoadPage( | |
38 const GURL url, | |
fgorski
2016/04/28 11:32:20
const ref
dougarnett
2016/04/28 20:13:13
Done.
| |
39 content::SessionStorageNamespace* session_storage_namespace, | |
40 const gfx::Size& size, | |
41 const LoadPageCallback& callback); | |
42 | |
43 void StopLoad(); | |
fgorski
2016/04/28 11:32:20
nit: StopLoading? Also Cancel is perfect here.
dougarnett
2016/04/28 20:13:13
Done.
| |
44 | |
45 private: | |
46 // Not owned. | |
47 Profile* profile_; | |
fgorski
2016/04/28 11:32:20
Not sure if that is doable, but see if you can wor
dougarnett
2016/04/28 20:13:13
updated to pass in PrerenderManager instead
| |
48 PrerenderManager* manager_; | |
49 }; | |
50 | |
51 } // namespace offline_pages | |
52 | |
53 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ | |
OLD | NEW |