Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
|
noyau (Ping after 24h)
2015/02/19 09:15:43
2015 :)
sdefresne
2015/02/19 10:50:12
We generally don't change the copyright line when
| |
| 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 COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_ | |
| 6 #define COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/mac/scoped_nsobject.h" | |
|
droger
2015/02/19 09:38:49
Remove.
sdefresne
2015/02/19 10:50:12
Done.
| |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #include "base/memory/weak_ptr.h" | |
| 13 #include "components/dom_distiller/core/distiller_page.h" | |
| 14 #include "ios/web/public/web_state/web_state_observer.h" | |
| 15 | |
| 16 class GURL; | |
|
droger
2015/02/19 09:38:49
You need to actually include gurl.h
sdefresne
2015/02/19 10:50:12
Done.
| |
| 17 | |
| 18 namespace ios { | |
| 19 class WebControllerProvider; | |
| 20 } | |
| 21 | |
| 22 namespace web { | |
| 23 class BrowserState; | |
| 24 class WebState; | |
| 25 } | |
| 26 | |
| 27 namespace dom_distiller { | |
| 28 | |
| 29 class DistillerWebStateObserver; | |
| 30 | |
| 31 // Loads urls and injects JavaScript into a page, extracting the distilled page | |
|
droger
2015/02/19 09:38:49
s/urls/URLs/
sdefresne
2015/02/19 10:50:12
Done.
| |
| 32 // content. | |
| 33 class DistillerPageIOS : public DistillerPage { | |
| 34 public: | |
| 35 explicit DistillerPageIOS(web::BrowserState* browser_state); | |
| 36 ~DistillerPageIOS() override; | |
| 37 | |
| 38 protected: | |
| 39 void DistillPageImpl(const GURL& url, const std::string& script) override; | |
| 40 | |
| 41 private: | |
| 42 friend class DistillerWebStateObserver; | |
| 43 // Called by |web_state_observer_| once the page has finished loading. | |
| 44 void OnLoadURLDone(web::PageLoadCompletionStatus load_completion_status); | |
| 45 // Called once the |script_| has been evaluated on the page. | |
| 46 void HandleJavaScriptResultString(NSString* result); | |
| 47 | |
| 48 web::BrowserState* browser_state_; | |
| 49 GURL url_; | |
| 50 std::string script_; | |
| 51 scoped_ptr<ios::WebControllerProvider> provider_; | |
| 52 scoped_ptr<DistillerWebStateObserver> web_state_observer_; | |
| 53 base::WeakPtrFactory<DistillerPageIOS> weak_ptr_factory_; | |
| 54 }; | |
| 55 | |
| 56 } // namespace dom_distiller | |
| 57 | |
| 58 #endif // COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_ | |
| OLD | NEW |