| 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_PRERENDER_ADAPTER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_ | 6 #define CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "chrome/browser/prerender/prerender_handle.h" | 10 #include "chrome/browser/prerender/prerender_handle.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 virtual void OnPrerenderStop() = 0; | 41 virtual void OnPrerenderStop() = 0; |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 Observer(); | 44 Observer(); |
| 45 virtual ~Observer(); | 45 virtual ~Observer(); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 explicit PrerenderAdapter(PrerenderAdapter::Observer* observer); | 48 explicit PrerenderAdapter(PrerenderAdapter::Observer* observer); |
| 49 ~PrerenderAdapter() override; | 49 ~PrerenderAdapter() override; |
| 50 | 50 |
| 51 // Returns whether prerendering is enabled and configured. | |
| 52 virtual bool CanPrerender() const; | |
| 53 | |
| 54 // Starts prerendering |url| for offlining. There must be no active | 51 // Starts prerendering |url| for offlining. There must be no active |
| 55 // prerender request when calling this. Returns whether it was able | 52 // prerender request when calling this. Returns whether it was able |
| 56 // to start the prerendering operation. | 53 // to start the prerendering operation. |
| 57 virtual bool StartPrerender( | 54 virtual bool StartPrerender( |
| 58 content::BrowserContext* browser_context, | 55 content::BrowserContext* browser_context, |
| 59 const GURL& url, | 56 const GURL& url, |
| 60 content::SessionStorageNamespace* session_storage_namespace, | 57 content::SessionStorageNamespace* session_storage_namespace, |
| 61 const gfx::Size& size); | 58 const gfx::Size& size); |
| 62 | 59 |
| 63 // Returns a pointer to the prerendered WebContents. This should only be | 60 // Returns a pointer to the prerendered WebContents. This should only be |
| (...skipping 30 matching lines...) Expand all Loading... |
| 94 | 91 |
| 95 // Observer of active handle events. Not owned. | 92 // Observer of active handle events. Not owned. |
| 96 PrerenderAdapter::Observer* observer_; | 93 PrerenderAdapter::Observer* observer_; |
| 97 | 94 |
| 98 DISALLOW_COPY_AND_ASSIGN(PrerenderAdapter); | 95 DISALLOW_COPY_AND_ASSIGN(PrerenderAdapter); |
| 99 }; | 96 }; |
| 100 | 97 |
| 101 } // namespace offline_pages | 98 } // namespace offline_pages |
| 102 | 99 |
| 103 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_ | 100 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_ |
| OLD | NEW |