OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 RenderViewHost* render_view_host() { return render_view_host_; } | 60 RenderViewHost* render_view_host() { return render_view_host_; } |
61 // Allows replacing of the RenderViewHost owned by this class, including | 61 // Allows replacing of the RenderViewHost owned by this class, including |
62 // replacing with a NULL value. When a caller uses this, the caller will | 62 // replacing with a NULL value. When a caller uses this, the caller will |
63 // own (and is responsible for freeing) the old RVH. | 63 // own (and is responsible for freeing) the old RVH. |
64 void set_render_view_host(RenderViewHost* rvh) { render_view_host_ = rvh; } | 64 void set_render_view_host(RenderViewHost* rvh) { render_view_host_ = rvh; } |
65 ViewHostMsg_FrameNavigate_Params* navigate_params() { | 65 ViewHostMsg_FrameNavigate_Params* navigate_params() { |
66 return navigate_params_.get(); | 66 return navigate_params_.get(); |
67 } | 67 } |
68 string16 title() const { return title_; } | 68 string16 title() const { return title_; } |
69 int32 page_id() const { return page_id_; } | 69 int32 page_id() const { return page_id_; } |
| 70 bool has_stopped_loading() const { return has_stopped_loading_; } |
70 | 71 |
71 // Indicates whether this prerendered page can be used for the provided | 72 // Indicates whether this prerendered page can be used for the provided |
72 // URL, i.e. whether there is a match. | 73 // URL, i.e. whether there is a match. |
73 bool MatchesURL(const GURL& url) const; | 74 bool MatchesURL(const GURL& url) const; |
74 | 75 |
75 // RenderViewHostDelegate implementation. | 76 // RenderViewHostDelegate implementation. |
76 virtual RenderViewHostDelegate::View* GetViewDelegate(); | 77 virtual RenderViewHostDelegate::View* GetViewDelegate(); |
77 virtual const GURL& GetURL() const; | 78 virtual const GURL& GetURL() const; |
78 virtual ViewType::Type GetRenderViewType() const; | 79 virtual ViewType::Type GetRenderViewType() const; |
79 virtual int GetBrowserWindowID() const; | 80 virtual int GetBrowserWindowID() const; |
80 virtual void DidNavigate(RenderViewHost* render_view_host, | 81 virtual void DidNavigate(RenderViewHost* render_view_host, |
81 const ViewHostMsg_FrameNavigate_Params& params); | 82 const ViewHostMsg_FrameNavigate_Params& params); |
82 virtual void UpdateTitle(RenderViewHost* render_view_host, | 83 virtual void UpdateTitle(RenderViewHost* render_view_host, |
83 int32 page_id, | 84 int32 page_id, |
84 const std::wstring& title); | 85 const std::wstring& title); |
85 virtual WebPreferences GetWebkitPrefs(); | 86 virtual WebPreferences GetWebkitPrefs(); |
86 virtual void ProcessDOMUIMessage(const ViewHostMsg_DomMessage_Params& params); | 87 virtual void ProcessDOMUIMessage(const ViewHostMsg_DomMessage_Params& params); |
87 virtual void RunJavaScriptMessage(const std::wstring& message, | 88 virtual void RunJavaScriptMessage(const std::wstring& message, |
88 const std::wstring& default_prompt, | 89 const std::wstring& default_prompt, |
89 const GURL& frame_url, | 90 const GURL& frame_url, |
90 const int flags, | 91 const int flags, |
91 IPC::Message* reply_msg, | 92 IPC::Message* reply_msg, |
92 bool* did_suppress_message); | 93 bool* did_suppress_message); |
93 virtual void Close(RenderViewHost* render_view_host); | 94 virtual void Close(RenderViewHost* render_view_host); |
| 95 virtual void DidStopLoading(); |
94 virtual RendererPreferences GetRendererPrefs(Profile* profile) const; | 96 virtual RendererPreferences GetRendererPrefs(Profile* profile) const; |
95 | 97 |
96 // RenderViewHostDelegate::View | 98 // RenderViewHostDelegate::View |
97 virtual void CreateNewWindow( | 99 virtual void CreateNewWindow( |
98 int route_id, | 100 int route_id, |
99 const ViewHostMsg_CreateWindow_Params& params); | 101 const ViewHostMsg_CreateWindow_Params& params); |
100 virtual void CreateNewWidget(int route_id, WebKit::WebPopupType popup_type); | 102 virtual void CreateNewWidget(int route_id, WebKit::WebPopupType popup_type); |
101 virtual void CreateNewFullscreenWidget( | 103 virtual void CreateNewFullscreenWidget( |
102 int route_id, WebKit::WebPopupType popup_type); | 104 int route_id, WebKit::WebPopupType popup_type); |
103 virtual void ShowCreatedWindow(int route_id, | 105 virtual void ShowCreatedWindow(int route_id, |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 string16 title_; | 201 string16 title_; |
200 int32 page_id_; | 202 int32 page_id_; |
201 GURL url_; | 203 GURL url_; |
202 NotificationRegistrar registrar_; | 204 NotificationRegistrar registrar_; |
203 | 205 |
204 // A vector of URLs that this prerendered page matches against. | 206 // A vector of URLs that this prerendered page matches against. |
205 // This array can contain more than element as a result of redirects, | 207 // This array can contain more than element as a result of redirects, |
206 // such as HTTP redirects or javascript redirects. | 208 // such as HTTP redirects or javascript redirects. |
207 std::vector<GURL> alias_urls_; | 209 std::vector<GURL> alias_urls_; |
208 | 210 |
| 211 bool has_stopped_loading_; |
| 212 |
209 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); | 213 DISALLOW_COPY_AND_ASSIGN(PrerenderContents); |
210 }; | 214 }; |
211 | 215 |
212 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ | 216 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_CONTENTS_H_ |
OLD | NEW |