Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1287)

Side by Side Diff: components/dom_distiller/ios/distiller_page_ios.h

Issue 2327783002: Fix domdistiller for new JS execution (Closed)
Patch Set: test & comment Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | components/dom_distiller/ios/distiller_page_ios.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_ 5 #ifndef COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_
6 #define COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_ 6 #define COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 26 matching lines...) Expand all
37 bool StringifyOutput() override; 37 bool StringifyOutput() override;
38 void DistillPageImpl(const GURL& url, const std::string& script) override; 38 void DistillPageImpl(const GURL& url, const std::string& script) override;
39 39
40 private: 40 private:
41 friend class DistillerWebStateObserver; 41 friend class DistillerWebStateObserver;
42 42
43 // Called by |web_state_observer_| once the page has finished loading. 43 // Called by |web_state_observer_| once the page has finished loading.
44 void OnLoadURLDone(web::PageLoadCompletionStatus load_completion_status); 44 void OnLoadURLDone(web::PageLoadCompletionStatus load_completion_status);
45 45
46 // Called once the |script_| has been evaluated on the page. 46 // Called once the |script_| has been evaluated on the page.
47 void HandleJavaScriptResultString(NSString* result); 47 void HandleJavaScriptResult(id result);
48
49 // Converts result of WKWebView script evaluation to base::Value
50 std::unique_ptr<base::Value> ValueResultFromScriptResult(id wk_result);
48 51
49 web::BrowserState* browser_state_; 52 web::BrowserState* browser_state_;
50 GURL url_; 53 GURL url_;
51 std::string script_; 54 std::string script_;
52 std::unique_ptr<ios::WebControllerProvider> provider_; 55 std::unique_ptr<ios::WebControllerProvider> provider_;
53 std::unique_ptr<DistillerWebStateObserver> web_state_observer_; 56 std::unique_ptr<DistillerWebStateObserver> web_state_observer_;
54 base::WeakPtrFactory<DistillerPageIOS> weak_ptr_factory_; 57 base::WeakPtrFactory<DistillerPageIOS> weak_ptr_factory_;
55 }; 58 };
56 59
57 } // namespace dom_distiller 60 } // namespace dom_distiller
58 61
59 #endif // COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_ 62 #endif // COMPONENTS_DOM_DISTILLER_IOS_DISTILLER_PAGE_IOS_H_
OLDNEW
« no previous file with comments | « no previous file | components/dom_distiller/ios/distiller_page_ios.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698