| 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_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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // Returns whether the loader has successfully loaded web contents. | 69 // Returns whether the loader has successfully loaded web contents. |
| 70 // Note that |StopLoading()| should be used to clear this state once | 70 // Note that |StopLoading()| should be used to clear this state once |
| 71 // the loaded web contents are no longer needed. | 71 // the loaded web contents are no longer needed. |
| 72 virtual bool IsLoaded(); | 72 virtual bool IsLoaded(); |
| 73 | 73 |
| 74 // Overrides the prerender stack adapter for unit testing. | 74 // Overrides the prerender stack adapter for unit testing. |
| 75 void SetAdapterForTesting( | 75 void SetAdapterForTesting( |
| 76 std::unique_ptr<PrerenderAdapter> prerender_adapter); | 76 std::unique_ptr<PrerenderAdapter> prerender_adapter); |
| 77 | 77 |
| 78 // PrerenderAdapter::Observer implementation: | 78 // PrerenderAdapter::Observer implementation: |
| 79 void OnPrerenderStart() override; | |
| 80 void OnPrerenderStopLoading() override; | 79 void OnPrerenderStopLoading() override; |
| 81 void OnPrerenderDomContentLoaded() override; | 80 void OnPrerenderDomContentLoaded() override; |
| 82 void OnPrerenderStop() override; | 81 void OnPrerenderStop() override; |
| 83 | 82 |
| 84 // SnapshotController::Client implementation: | 83 // SnapshotController::Client implementation: |
| 85 void StartSnapshot() override; | 84 void StartSnapshot() override; |
| 86 | 85 |
| 87 private: | 86 private: |
| 88 // State of the loader (only one request may be active at a time). | 87 // State of the loader (only one request may be active at a time). |
| 89 enum class State { | 88 enum class State { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // Callback to call when the active load request completes, fails, or is | 124 // Callback to call when the active load request completes, fails, or is |
| 126 // canceled. | 125 // canceled. |
| 127 LoadPageCallback callback_; | 126 LoadPageCallback callback_; |
| 128 | 127 |
| 129 DISALLOW_COPY_AND_ASSIGN(PrerenderingLoader); | 128 DISALLOW_COPY_AND_ASSIGN(PrerenderingLoader); |
| 130 }; | 129 }; |
| 131 | 130 |
| 132 } // namespace offline_pages | 131 } // namespace offline_pages |
| 133 | 132 |
| 134 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ | 133 #endif // CHROME_BROWSER_ANDROID_OFFLINE_PAGES_PRERENDERING_LOADER_H_ |
| OLD | NEW |