Chromium Code Reviews| Index: components/dom_distiller/ios/distiller_page_ios.h |
| diff --git a/components/dom_distiller/ios/distiller_page_ios.h b/components/dom_distiller/ios/distiller_page_ios.h |
| index ddd55f31954c92a83aa7b78bcc8dc27b34e64af5..b74a7b7d2ab4dccff1b04155c76295de2ef3b38f 100644 |
| --- a/components/dom_distiller/ios/distiller_page_ios.h |
| +++ b/components/dom_distiller/ios/distiller_page_ios.h |
| @@ -10,10 +10,13 @@ |
| #include "base/memory/weak_ptr.h" |
| #include "components/dom_distiller/core/distiller_page.h" |
| -#include "components/dom_distiller/ios/favicon_web_state_dispatcher.h" |
| #include "ios/web/public/web_state/web_state_observer.h" |
|
gambard
2016/12/27 13:56:57
Is this import needed?
Olivier
2016/12/27 14:52:14
Yes. (PageComplectionStatus enum).
|
| #include "url/gurl.h" |
| +namespace web { |
| +class BrowserState; |
| +} |
| + |
| namespace dom_distiller { |
| class DistillerWebStateObserver; |
| @@ -22,19 +25,22 @@ class DistillerWebStateObserver; |
| // content. |
| class DistillerPageIOS : public DistillerPage { |
| public: |
| - explicit DistillerPageIOS(FaviconWebStateDispatcher* web_state_dispatcher); |
| + explicit DistillerPageIOS(web::BrowserState* browser_state); |
| ~DistillerPageIOS() override; |
| protected: |
| bool StringifyOutput() override; |
| void DistillPageImpl(const GURL& url, const std::string& script) override; |
| - private: |
| - friend class DistillerWebStateObserver; |
| + virtual void AttachWebState(std::unique_ptr<web::WebState> web_state); |
|
gambard
2016/12/27 13:56:57
Comment
Olivier
2016/12/27 14:52:14
Done.
|
| + virtual std::unique_ptr<web::WebState> DetachWebState(); |
| // Called by |web_state_observer_| once the page has finished loading. |
| - void OnLoadURLDone(web::PageLoadCompletionStatus load_completion_status); |
| + virtual void OnLoadURLDone( |
| + web::PageLoadCompletionStatus load_completion_status); |
| + private: |
| + friend class DistillerWebStateObserver; |
| // Called once the |script_| has been evaluated on the page. |
| void HandleJavaScriptResult(id result); |
| @@ -43,8 +49,8 @@ class DistillerPageIOS : public DistillerPage { |
| GURL url_; |
| std::string script_; |
| - web::WebState* web_state_; |
| - FaviconWebStateDispatcher* web_state_dispatcher_; |
| + web::BrowserState* browser_state_; |
| + std::unique_ptr<web::WebState> web_state_; |
| std::unique_ptr<DistillerWebStateObserver> web_state_observer_; |
| base::WeakPtrFactory<DistillerPageIOS> weak_ptr_factory_; |
| }; |