| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_ |
| 6 #define IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_ |
| 7 |
| 8 #include <memory> |
| 9 #include <string> |
| 10 |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "components/dom_distiller/ios/distiller_page_ios.h" |
| 13 #include "components/reading_list/ios/favicon_web_state_dispatcher.h" |
| 14 #include "ios/web/public/web_state/web_state_observer.h" |
| 15 #include "url/gurl.h" |
| 16 |
| 17 namespace reading_list { |
| 18 |
| 19 // Loads URLs and injects JavaScript into a page, extracting the distilled page |
| 20 // content. |
| 21 class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS { |
| 22 public: |
| 23 explicit ReadingListDistillerPage( |
| 24 FaviconWebStateDispatcher* web_state_dispatcher); |
| 25 ~ReadingListDistillerPage() override; |
| 26 |
| 27 protected: |
| 28 void DistillPageImpl(const GURL& url, const std::string& script) override; |
| 29 void OnDistillationDone(const GURL& page_url, |
| 30 const base::Value* value) override; |
| 31 void OnLoadURLDone( |
| 32 web::PageLoadCompletionStatus load_completion_status) override; |
| 33 |
| 34 private: |
| 35 void DelayedOnLoadURLDone( |
| 36 web::PageLoadCompletionStatus load_completion_status); |
| 37 FaviconWebStateDispatcher* web_state_dispatcher_; |
| 38 base::WeakPtrFactory<ReadingListDistillerPage> weak_ptr_factory_; |
| 39 }; |
| 40 |
| 41 } // namespace reading_list |
| 42 |
| 43 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_ |
| OLD | NEW |