| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace offline_pages { | 24 namespace offline_pages { |
| 25 | 25 |
| 26 // An adapter for managing a prerendering request for offlining. This handles | 26 // An adapter for managing a prerendering request for offlining. This handles |
| 27 // all calls into the prerender stack and tracks the active prerender handle. | 27 // all calls into the prerender stack and tracks the active prerender handle. |
| 28 class PrerenderAdapter : public prerender::PrerenderHandle::Observer { | 28 class PrerenderAdapter : public prerender::PrerenderHandle::Observer { |
| 29 public: | 29 public: |
| 30 // An observer of PrerenderHandle events that does not expose the handle. | 30 // An observer of PrerenderHandle events that does not expose the handle. |
| 31 class Observer { | 31 class Observer { |
| 32 public: | 32 public: |
| 33 // Signals that the prerender has started running. | |
| 34 virtual void OnPrerenderStart() = 0; | |
| 35 | |
| 36 // Signals that the prerender has had its load event. | 33 // Signals that the prerender has had its load event. |
| 37 virtual void OnPrerenderStopLoading() = 0; | 34 virtual void OnPrerenderStopLoading() = 0; |
| 38 | 35 |
| 39 // Signals that the prerender has had its 'DOMContentLoaded' event. | 36 // Signals that the prerender has had its 'DOMContentLoaded' event. |
| 40 virtual void OnPrerenderDomContentLoaded() = 0; | 37 virtual void OnPrerenderDomContentLoaded() = 0; |
| 41 | 38 |
| 42 // Signals that the prerender has stopped running and any retrieved | 39 // Signals that the prerender has stopped running and any retrieved |
| 43 // WebContents (via |GetWebContents()|) have become invalidated. | 40 // WebContents (via |GetWebContents()|) have become invalidated. |
| 44 virtual void OnPrerenderStop() = 0; | 41 virtual void OnPrerenderStop() = 0; |
| 45 | 42 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 94 |
| 98 // Observer of active handle events. Not owned. | 95 // Observer of active handle events. Not owned. |
| 99 PrerenderAdapter::Observer* observer_; | 96 PrerenderAdapter::Observer* observer_; |
| 100 | 97 |
| 101 DISALLOW_COPY_AND_ASSIGN(PrerenderAdapter); | 98 DISALLOW_COPY_AND_ASSIGN(PrerenderAdapter); |
| 102 }; | 99 }; |
| 103 | 100 |
| 104 } // namespace offline_pages | 101 } // namespace offline_pages |
| 105 | 102 |
| 106 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_ | 103 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDER_ADAPTER_H_ |
| OLD | NEW |