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