OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ | 5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ |
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ | 6 #define COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Creates a new WebContents, adds |this| as an observer, and loads the | 93 // Creates a new WebContents, adds |this| as an observer, and loads the |
94 // |url|. | 94 // |url|. |
95 virtual void CreateNewWebContents(const GURL& url); | 95 virtual void CreateNewWebContents(const GURL& url); |
96 | 96 |
97 // Injects and executes JavaScript in the context of a loaded page. This | 97 // Injects and executes JavaScript in the context of a loaded page. This |
98 // must only be called after the page has successfully loaded. | 98 // must only be called after the page has successfully loaded. |
99 void ExecuteJavaScript(); | 99 void ExecuteJavaScript(); |
100 | 100 |
101 // Called when the distillation is done or if the page load failed. | 101 // Called when the distillation is done or if the page load failed. |
102 void OnWebContentsDistillationDone(const GURL& page_url, | 102 void OnWebContentsDistillationDone(const GURL& page_url, |
| 103 const base::TimeTicks& javascript_start, |
103 const base::Value* value); | 104 const base::Value* value); |
104 | 105 |
105 // The current state of the |DistillerPage|, initially |IDLE|. | 106 // The current state of the |DistillerPage|, initially |IDLE|. |
106 State state_; | 107 State state_; |
107 | 108 |
108 // The JavaScript to inject to extract content. | 109 // The JavaScript to inject to extract content. |
109 std::string script_; | 110 std::string script_; |
110 | 111 |
111 scoped_ptr<SourcePageHandleWebContents> source_page_handle_; | 112 scoped_ptr<SourcePageHandleWebContents> source_page_handle_; |
112 | 113 |
113 content::BrowserContext* browser_context_; | 114 content::BrowserContext* browser_context_; |
114 gfx::Size render_view_size_; | 115 gfx::Size render_view_size_; |
115 DISALLOW_COPY_AND_ASSIGN(DistillerPageWebContents); | 116 DISALLOW_COPY_AND_ASSIGN(DistillerPageWebContents); |
116 }; | 117 }; |
117 | 118 |
118 } // namespace dom_distiller | 119 } // namespace dom_distiller |
119 | 120 |
120 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ | 121 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_DISTILLER_PAGE_WEB_CONTENTS_H_ |
OLD | NEW |