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 2635193003: IOS Reading distillation: Handle Google AMP iFrame. (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 0678a91bafb1e057f287a71d376eb42648ebf46d..f2e1bb927be8495a298ec32c8eb0bb3a38a2c655 100644
--- a/ios/chrome/browser/reading_list/reading_list_distiller_page.h
+++ b/ios/chrome/browser/reading_list/reading_list_distiller_page.h
@@ -37,8 +37,19 @@ class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS {
web::PageLoadCompletionStatus load_completion_status) override;
private:
- void DelayedOnLoadURLDone(
- web::PageLoadCompletionStatus load_completion_status);
+ // Work around the fact that articles opened from Google Search page and
+ // Google News are presented in an iframe. This method detects if the current
+ // page is a Google AMP and navigate to the iframe in that case.
+ // Returns whether the current page is a Google AMP page.
+ // IsGoogleCachedAMP will determine if the current page is a Google AMP page.
+ bool IsGoogleCachedAMP();
+ // HandleGoogleCachedAMP will navigate to the iframe containing the actual
+ // article page.
+ bool HandleGoogleCachedAMP();
+ bool HandleGoogleCachedAMPJavaScriptResult(id result, NSError* error);
+
+ void WaitForPageLoadCompletion();
+ void DelayedOnLoadURLDone();
FaviconWebStateDispatcher* web_state_dispatcher_;
base::WeakPtrFactory<ReadingListDistillerPage> weak_ptr_factory_;
};

Powered by Google App Engine
This is Rietveld 408576698