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

Side by Side Diff: ios/chrome/browser/reading_list/reading_list_distiller_page.h

Issue 2635193003: IOS Reading distillation: Handle Google AMP iFrame. (Closed)
Patch Set: feedback 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 unified diff | Download patch
OLDNEW
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 IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_ 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_
6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_ 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 19 matching lines...) Expand all
30 ~ReadingListDistillerPage() override; 30 ~ReadingListDistillerPage() override;
31 31
32 protected: 32 protected:
33 void DistillPageImpl(const GURL& url, const std::string& script) override; 33 void DistillPageImpl(const GURL& url, const std::string& script) override;
34 void OnDistillationDone(const GURL& page_url, 34 void OnDistillationDone(const GURL& page_url,
35 const base::Value* value) override; 35 const base::Value* value) override;
36 void OnLoadURLDone( 36 void OnLoadURLDone(
37 web::PageLoadCompletionStatus load_completion_status) override; 37 web::PageLoadCompletionStatus load_completion_status) override;
38 38
39 private: 39 private:
40 void DelayedOnLoadURLDone( 40 // Work around the fact that articles opened from Google Search page and
41 web::PageLoadCompletionStatus load_completion_status); 41 // Google News are presented in an iframe. This method detects if the current
42 // page is a Google AMP and navigate to the iframe in that case.
43 // Returns whether the current page is a Google AMP page.
44 // IsGoogleCachedAMPPage will determine if the current page is a Google AMP
45 // page.
46 bool IsGoogleCachedAMPPage();
47 // HandleGoogleCachedAMPPage will navigate to the iframe containing the actual
48 // article page.
49 void HandleGoogleCachedAMPPage();
50 bool HandleGoogleCachedAMPPageJavaScriptResult(id result, NSError* error);
stkhapugin 2017/01/18 12:38:24 Please add comments to these methods.
51
52 void WaitForPageLoadCompletion();
53 void DelayedOnLoadURLDone();
42 FaviconWebStateDispatcher* web_state_dispatcher_; 54 FaviconWebStateDispatcher* web_state_dispatcher_;
43 base::WeakPtrFactory<ReadingListDistillerPage> weak_ptr_factory_; 55 base::WeakPtrFactory<ReadingListDistillerPage> weak_ptr_factory_;
44 }; 56 };
45 57
46 } // namespace reading_list 58 } // namespace reading_list
47 59
48 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_ 60 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/reading_list/BUILD.gn ('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