Chromium Code Reviews| Index: ios/chrome/browser/reading_list/reading_list_distiller_page.h |
| diff --git a/ios/chrome/browser/reading_list/reading_list_distiller_page.h b/ios/chrome/browser/reading_list/reading_list_distiller_page.h |
| index 891de56b75bacf33df1669a332442005352dad33..3780104780231860f7bd48e6d8f53beb607747cf 100644 |
| --- a/ios/chrome/browser/reading_list/reading_list_distiller_page.h |
| +++ b/ios/chrome/browser/reading_list/reading_list_distiller_page.h |
| @@ -29,6 +29,11 @@ class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS { |
| FaviconWebStateDispatcher* web_state_dispatcher); |
| ~ReadingListDistillerPage() override; |
| + // Sets a callback that will be called just before distillation happen with |
| + // the URL of the page that will effectively be distilled. |
| + typedef base::Callback<void(const GURL&, const GURL&)> RedirectionCallback; |
| + void SetRedirectionCallback(RedirectionCallback redirection_callback); |
|
jif
2017/01/20 10:23:19
pass the RedirectionCallback by reference
Olivier
2017/01/20 10:47:07
https://cs.chromium.org/chromium/src/docs/callback
|
| + |
| protected: |
| void DistillPageImpl(const GURL& url, const std::string& script) override; |
| void OnDistillationDone(const GURL& page_url, |
| @@ -53,7 +58,7 @@ class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS { |
| // Handles the JavaScript response. If the URL of the iframe is returned, |
| // triggers a navigation to it. Stop distillation of the page there as the new |
| // load will trigger a new distillation. |
| - bool HandleGoogleCachedAMPPageJavaScriptResult(id result, NSError* error); |
| + bool HandleGoogleCachedAMPPageJavaScriptResult(id result, id error); |
| // Waits a delay then calls DelayedOnLoadURLDone. |
| void WaitForPageLoadCompletion(); |
| @@ -61,6 +66,10 @@ class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS { |
| // Continues distillation by calling superclass |OnLoadURLDone|. |
| void DelayedOnLoadURLDone(); |
| + RedirectionCallback redirection_callback_; |
| + GURL original_url_; |
| + GURL redirected_url_; |
| + |
| FaviconWebStateDispatcher* web_state_dispatcher_; |
| base::WeakPtrFactory<ReadingListDistillerPage> weak_ptr_factory_; |
| }; |