| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 WEBKIT_GLUE_WEBFRAMELOADERCLIENT_IMPL_H__ | 5 #ifndef WEBKIT_GLUE_WEBFRAMELOADERCLIENT_IMPL_H_ |
| 6 #define WEBKIT_GLUE_WEBFRAMELOADERCLIENT_IMPL_H__ | 6 #define WEBKIT_GLUE_WEBFRAMELOADERCLIENT_IMPL_H_ |
| 7 | 7 |
| 8 #include "FrameLoaderClient.h" | 8 #include "FrameLoaderClient.h" |
| 9 #include <wtf/RefPtr.h> | 9 #include <wtf/RefPtr.h> |
| 10 | 10 |
| 11 #include "base/scoped_ptr.h" | |
| 12 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 13 #include "webkit/api/public/WebNavigationPolicy.h" | 12 #include "webkit/api/public/WebNavigationPolicy.h" |
| 14 #include "webkit/glue/webview_delegate.h" | 13 #include "webkit/glue/webview_delegate.h" |
| 15 | 14 |
| 16 namespace WebCore { | |
| 17 class Frame; | |
| 18 class HTMLFormElement; | |
| 19 class Widget; | |
| 20 } | |
| 21 | |
| 22 namespace webkit_glue { | |
| 23 class AltErrorPageResourceFetcher; | |
| 24 } | |
| 25 | |
| 26 class WebFrameImpl; | 15 class WebFrameImpl; |
| 27 class WebPluginContainer; | 16 class WebPluginContainer; |
| 28 | 17 |
| 29 | |
| 30 class WebFrameLoaderClient : public WebCore::FrameLoaderClient { | 18 class WebFrameLoaderClient : public WebCore::FrameLoaderClient { |
| 31 public: | 19 public: |
| 32 WebFrameLoaderClient(WebFrameImpl* webframe); | 20 WebFrameLoaderClient(WebFrameImpl* webframe); |
| 33 virtual ~WebFrameLoaderClient(); | 21 virtual ~WebFrameLoaderClient(); |
| 34 | 22 |
| 35 WebFrameImpl* webframe() const { return webframe_; } | 23 WebFrameImpl* webframe() const { return webframe_; } |
| 36 | 24 |
| 37 // WebCore::FrameLoaderClient ---------------------------------------------- | 25 // WebCore::FrameLoaderClient ---------------------------------------------- |
| 38 | 26 |
| 39 virtual void frameLoaderDestroyed(); | 27 virtual void frameLoaderDestroyed(); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 185 |
| 198 virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, | 186 virtual WebCore::ObjectContentType objectContentType(const WebCore::KURL& url, |
| 199 const WebCore::String& mimeType); | 187 const WebCore::String& mimeType); |
| 200 virtual WebCore::String overrideMediaType() const; | 188 virtual WebCore::String overrideMediaType() const; |
| 201 | 189 |
| 202 virtual void didPerformFirstNavigation() const; | 190 virtual void didPerformFirstNavigation() const; |
| 203 | 191 |
| 204 virtual void registerForIconNotification(bool listen = true); | 192 virtual void registerForIconNotification(bool listen = true); |
| 205 | 193 |
| 206 private: | 194 private: |
| 207 // Callback function for download of alternate 404 pages. If the server is | |
| 208 // down or we take too long to download the page, |html| will be empty. | |
| 209 void Alt404PageFinished(WebFrame* frame, | |
| 210 const WebKit::WebURLError& original_error, | |
| 211 const std::string& html); | |
| 212 | |
| 213 void makeDocumentView(); | 195 void makeDocumentView(); |
| 214 | 196 |
| 215 // Given a NavigationAction, determine the associated WebNavigationPolicy. | 197 // Given a NavigationAction, determine the associated WebNavigationPolicy. |
| 216 // For example, a middle click means "open in background tab". | 198 // For example, a middle click means "open in background tab". |
| 217 static bool ActionSpecifiesNavigationPolicy( | 199 static bool ActionSpecifiesNavigationPolicy( |
| 218 const WebCore::NavigationAction& action, | 200 const WebCore::NavigationAction& action, |
| 219 WebKit::WebNavigationPolicy* policy); | 201 WebKit::WebNavigationPolicy* policy); |
| 220 | 202 |
| 221 // Returns a valid GURL if we have an alt 404 server URL. | |
| 222 GURL GetAlt404PageUrl(WebCore::DocumentLoader* loader); | |
| 223 | |
| 224 // Returns NavigationGestureAuto if the last load was not user initiated, | 203 // Returns NavigationGestureAuto if the last load was not user initiated, |
| 225 // otherwise returns NavigationGestureUnknown. | 204 // otherwise returns NavigationGestureUnknown. |
| 226 NavigationGesture NavigationGestureForLastLoad(); | 205 NavigationGesture NavigationGestureForLastLoad(); |
| 227 | 206 |
| 228 // Called when a dummy back-forward navigation is intercepted. | 207 // Called when a dummy back-forward navigation is intercepted. |
| 229 void HandleBackForwardNavigation(const GURL&); | 208 void HandleBackForwardNavigation(const GURL&); |
| 230 | 209 |
| 231 // The WebFrame that owns this object and manages its lifetime. Therefore, | 210 // The WebFrame that owns this object and manages its lifetime. Therefore, |
| 232 // the web frame object is guaranteed to exist. | 211 // the web frame object is guaranteed to exist. |
| 233 WebFrameImpl* webframe_; | 212 WebFrameImpl* webframe_; |
| 234 | 213 |
| 235 // Resource fetcher for downloading an alternate 404 page. | |
| 236 scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_404_page_fetcher_; | |
| 237 | |
| 238 bool postpone_loading_data_; | |
| 239 std::string postponed_data_; | |
| 240 | |
| 241 // True if makeRepresentation was called. We don't actually have a concept | 214 // True if makeRepresentation was called. We don't actually have a concept |
| 242 // of a "representation", but we need to know when we're expected to have one. | 215 // of a "representation", but we need to know when we're expected to have one. |
| 243 // See finishedLoading(). | 216 // See finishedLoading(). |
| 244 bool has_representation_; | 217 bool has_representation_; |
| 245 | 218 |
| 246 // Used to help track client redirects. When a provisional load starts, it | 219 // Used to help track client redirects. When a provisional load starts, it |
| 247 // has no redirects in its chain. But in the case of client redirects, we want | 220 // has no redirects in its chain. But in the case of client redirects, we want |
| 248 // to add that initial load as a redirect. When we get a new provisional load | 221 // to add that initial load as a redirect. When we get a new provisional load |
| 249 // and the dest URL matches that load, we know that it was the result of a | 222 // and the dest URL matches that load, we know that it was the result of a |
| 250 // previous client redirect and the source should be added as a redirect. | 223 // previous client redirect and the source should be added as a redirect. |
| 251 // Both should be empty if unused. | 224 // Both should be empty if unused. |
| 252 GURL expected_client_redirect_src_; | 225 GURL expected_client_redirect_src_; |
| 253 GURL expected_client_redirect_dest_; | 226 GURL expected_client_redirect_dest_; |
| 254 | 227 |
| 255 // Contains a pointer to the plugin widget. | 228 // Contains a pointer to the plugin widget. |
| 256 WTF::RefPtr<WebPluginContainer> plugin_widget_; | 229 WTF::RefPtr<WebPluginContainer> plugin_widget_; |
| 257 | 230 |
| 258 // Indicates if we need to send over the initial notification to the plugin | 231 // Indicates if we need to send over the initial notification to the plugin |
| 259 // which specifies that the plugin should be ready to accept data. | 232 // which specifies that the plugin should be ready to accept data. |
| 260 bool sent_initial_response_to_plugin_; | 233 bool sent_initial_response_to_plugin_; |
| 261 | 234 |
| 262 // The navigation policy to use for the next call to dispatchCreatePage. | 235 // The navigation policy to use for the next call to dispatchCreatePage. |
| 263 WebKit::WebNavigationPolicy next_navigation_policy_; | 236 WebKit::WebNavigationPolicy next_navigation_policy_; |
| 264 }; | 237 }; |
| 265 | 238 |
| 266 #endif // #ifndef WEBKIT_GLUE_WEBFRAMELOADERCLIENT_IMPL_H__ | 239 #endif // #ifndef WEBKIT_GLUE_WEBFRAMELOADERCLIENT_IMPL_H_ |
| OLD | NEW |