| 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 "url/gurl.h" |
| 14 |
| 15 namespace web { |
| 16 class BrowserState; |
| 17 } |
| 18 |
| 19 namespace reading_list { |
| 20 |
| 21 class FaviconWebStateDispatcher; |
| 22 |
| 23 // An DistillerPageIOS that will retain WebState to allow favicon download and |
| 24 // and add a 2 seconds delay between loading and distillation. |
| 25 class ReadingListDistillerPage : public dom_distiller::DistillerPageIOS { |
| 26 public: |
| 27 explicit ReadingListDistillerPage( |
| 28 web::BrowserState* browser_state, |
| 29 FaviconWebStateDispatcher* web_state_dispatcher); |
| 30 ~ReadingListDistillerPage() override; |
| 31 |
| 32 protected: |
| 33 void DistillPageImpl(const GURL& url, const std::string& script) override; |
| 34 void OnDistillationDone(const GURL& page_url, |
| 35 const base::Value* value) override; |
| 36 void OnLoadURLDone( |
| 37 web::PageLoadCompletionStatus load_completion_status) override; |
| 38 |
| 39 private: |
| 40 void DelayedOnLoadURLDone( |
| 41 web::PageLoadCompletionStatus load_completion_status); |
| 42 FaviconWebStateDispatcher* web_state_dispatcher_; |
| 43 base::WeakPtrFactory<ReadingListDistillerPage> weak_ptr_factory_; |
| 44 }; |
| 45 |
| 46 } // namespace reading_list |
| 47 |
| 48 #endif // IOS_CHROME_BROWSER_READING_LIST_READING_LIST_DISTILLER_PAGE_H_ |
| OLD | NEW |