Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: ios/chrome/browser/reading_list/reading_list_distiller_page.h

Issue 2650593003: Store distilled URL during distillation in Reading List on iOS (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..8ebbfc80d42a8075b9b29628af6be86ddd660ff1 100644
--- a/ios/chrome/browser/reading_list/reading_list_distiller_page.h
+++ b/ios/chrome/browser/reading_list/reading_list_distiller_page.h
@@ -24,11 +24,17 @@ class FaviconWebStateDispatcher;
// and add a 2 seconds delay between loading and distillation.
class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS {
public:
+ typedef base::Callback<void(const GURL&, const GURL&)> RedirectionCallback;
+
explicit ReadingListDistillerPage(
web::BrowserState* browser_state,
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.
+ void SetRedirectionCallback(RedirectionCallback redirection_callback);
+
protected:
void DistillPageImpl(const GURL& url, const std::string& script) override;
void OnDistillationDone(const GURL& page_url,
@@ -53,7 +59,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 +67,9 @@ class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS {
// Continues distillation by calling superclass |OnLoadURLDone|.
void DelayedOnLoadURLDone();
+ RedirectionCallback redirection_callback_;
+ GURL original_url_;
+
FaviconWebStateDispatcher* web_state_dispatcher_;
base::WeakPtrFactory<ReadingListDistillerPage> weak_ptr_factory_;
};
« no previous file with comments | « ios/chrome/browser/dom_distiller/distiller_viewer.cc ('k') | ios/chrome/browser/reading_list/reading_list_distiller_page.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698