| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 class Frame; | 55 class Frame; |
| 56 class FrameView; | 56 class FrameView; |
| 57 class HistoryItem; | 57 class HistoryItem; |
| 58 class KURL; | 58 class KURL; |
| 59 class Node; | 59 class Node; |
| 60 class Range; | 60 class Range; |
| 61 class SubstituteData; | 61 class SubstituteData; |
| 62 struct WindowFeatures; | 62 struct WindowFeatures; |
| 63 } | 63 } |
| 64 | 64 |
| 65 namespace webkit_glue { | |
| 66 class AltErrorPageResourceFetcher; | |
| 67 } | |
| 68 | |
| 69 // Implementation of WebFrame, note that this is a reference counted object. | 65 // Implementation of WebFrame, note that this is a reference counted object. |
| 70 class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { | 66 class WebFrameImpl : public WebFrame, public base::RefCounted<WebFrameImpl> { |
| 71 public: | 67 public: |
| 72 WebFrameImpl(); | 68 WebFrameImpl(); |
| 73 ~WebFrameImpl(); | 69 ~WebFrameImpl(); |
| 74 | 70 |
| 75 static int live_object_count() { | 71 static int live_object_count() { |
| 76 return live_object_count_; | 72 return live_object_count_; |
| 77 } | 73 } |
| 78 | 74 |
| 79 // Called by the WebViewImpl to initialize its main frame: | 75 // Called by the WebViewImpl to initialize its main frame: |
| 80 void InitMainFrame(WebViewImpl* webview_impl); | 76 void InitMainFrame(WebViewImpl* webview_impl); |
| 81 | 77 |
| 82 // WebFrame | 78 // WebFrame |
| 83 virtual void Reload(); | 79 virtual void Reload(); |
| 84 virtual void LoadRequest(const WebKit::WebURLRequest& request); | 80 virtual void LoadRequest(const WebKit::WebURLRequest& request); |
| 85 virtual void LoadHistoryItem(const WebKit::WebHistoryItem& item); | 81 virtual void LoadHistoryItem(const WebKit::WebHistoryItem& item); |
| 86 virtual void LoadData( | 82 virtual void LoadData( |
| 87 const WebKit::WebData& data, | 83 const WebKit::WebData& data, |
| 88 const WebKit::WebString& mime_type, | 84 const WebKit::WebString& mime_type, |
| 89 const WebKit::WebString& text_encoding, | 85 const WebKit::WebString& text_encoding, |
| 90 const WebKit::WebURL& base_url, | 86 const WebKit::WebURL& base_url, |
| 91 const WebKit::WebURL& unreachable_url = WebKit::WebURL(), | 87 const WebKit::WebURL& unreachable_url = WebKit::WebURL(), |
| 92 bool replace = false); | 88 bool replace = false); |
| 93 virtual void LoadHTMLString( | 89 virtual void LoadHTMLString( |
| 94 const WebKit::WebData& data, | 90 const WebKit::WebData& data, |
| 95 const WebKit::WebURL& base_url, | 91 const WebKit::WebURL& base_url, |
| 96 const WebKit::WebURL& unreachable_url = WebKit::WebURL(), | 92 const WebKit::WebURL& unreachable_url = WebKit::WebURL(), |
| 97 bool replace = false); | 93 bool replace = false); |
| 98 virtual void LoadAlternateHTMLErrorPage( | |
| 99 const WebKit::WebURLRequest& request, | |
| 100 const WebKit::WebURLError& error, | |
| 101 const GURL& error_page_url, | |
| 102 bool replace, | |
| 103 const GURL& fake_url); | |
| 104 virtual void DispatchWillSendRequest(WebKit::WebURLRequest* request); | 94 virtual void DispatchWillSendRequest(WebKit::WebURLRequest* request); |
| 105 virtual void ExecuteScript(const WebKit::WebScriptSource& source); | 95 virtual void ExecuteScript(const WebKit::WebScriptSource& source); |
| 106 virtual void ExecuteScriptInNewContext( | 96 virtual void ExecuteScriptInNewContext( |
| 107 const WebKit::WebScriptSource* sources, int num_sources, | 97 const WebKit::WebScriptSource* sources, int num_sources, |
| 108 int extension_group); | 98 int extension_group); |
| 109 virtual void ExecuteScriptInNewWorld( | 99 virtual void ExecuteScriptInNewWorld( |
| 110 const WebKit::WebScriptSource* sources, int num_sources, | 100 const WebKit::WebScriptSource* sources, int num_sources, |
| 111 int extension_group); | 101 int extension_group); |
| 112 virtual bool InsertCSSStyles(const std::string& css); | 102 virtual bool InsertCSSStyles(const std::string& css); |
| 113 virtual WebKit::WebHistoryItem GetPreviousHistoryItem() const; | 103 virtual WebKit::WebHistoryItem GetPreviousHistoryItem() const; |
| 114 virtual WebKit::WebHistoryItem GetCurrentHistoryItem() const; | 104 virtual WebKit::WebHistoryItem GetCurrentHistoryItem() const; |
| 115 virtual GURL GetURL() const; | 105 virtual GURL GetURL() const; |
| 116 virtual GURL GetFavIconURL() const; | 106 virtual GURL GetFavIconURL() const; |
| 117 virtual GURL GetOSDDURL() const; | 107 virtual GURL GetOSDDURL() const; |
| 118 virtual int GetContentsPreferredWidth() const; | 108 virtual int GetContentsPreferredWidth() const; |
| 119 virtual WebKit::WebDataSource* GetDataSource() const; | 109 virtual WebKit::WebDataSource* GetDataSource() const; |
| 120 virtual WebKit::WebDataSource* GetProvisionalDataSource() const; | 110 virtual WebKit::WebDataSource* GetProvisionalDataSource() const; |
| 121 virtual void StopLoading(); | 111 virtual void StopLoading(); |
| 112 virtual bool IsLoading() const; |
| 122 virtual WebFrame* GetOpener() const; | 113 virtual WebFrame* GetOpener() const; |
| 123 virtual WebFrame* GetParent() const; | 114 virtual WebFrame* GetParent() const; |
| 124 virtual WebFrame* GetTop() const; | 115 virtual WebFrame* GetTop() const; |
| 125 virtual WebFrame* GetChildFrame(const std::wstring& xpath) const; | 116 virtual WebFrame* GetChildFrame(const std::wstring& xpath) const; |
| 126 virtual WebView* GetView() const; | 117 virtual WebView* GetView() const; |
| 127 virtual void GetForms(std::vector<WebKit::WebForm>* forms) const; | 118 virtual void GetForms(std::vector<WebKit::WebForm>* forms) const; |
| 128 virtual std::string GetSecurityOrigin() const; | 119 virtual std::string GetSecurityOrigin() const; |
| 129 | 120 |
| 130 // This method calls createRuntimeObject (in KJS::Bindings::Instance), which | 121 // This method calls createRuntimeObject (in KJS::Bindings::Instance), which |
| 131 // increments the refcount of the NPObject passed in. | 122 // increments the refcount of the NPObject passed in. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 virtual void PrintEnd(); | 192 virtual void PrintEnd(); |
| 202 | 193 |
| 203 PassRefPtr<WebCore::Frame> CreateChildFrame( | 194 PassRefPtr<WebCore::Frame> CreateChildFrame( |
| 204 const WebCore::FrameLoadRequest&, | 195 const WebCore::FrameLoadRequest&, |
| 205 WebCore::HTMLFrameOwnerElement* owner_element); | 196 WebCore::HTMLFrameOwnerElement* owner_element); |
| 206 | 197 |
| 207 // WebFrameImpl | 198 // WebFrameImpl |
| 208 void Layout(); | 199 void Layout(); |
| 209 void Paint(skia::PlatformCanvas* canvas, const WebKit::WebRect& rect); | 200 void Paint(skia::PlatformCanvas* canvas, const WebKit::WebRect& rect); |
| 210 | 201 |
| 211 bool IsLoading(); | |
| 212 | |
| 213 void CreateFrameView(); | 202 void CreateFrameView(); |
| 214 | 203 |
| 215 // The plugin delegate is used to get notifications when downloads complete. | 204 // The plugin delegate is used to get notifications when downloads complete. |
| 216 // This is used by the NPAPI method getURLNotify. plugin_delegate() may | 205 // This is used by the NPAPI method getURLNotify. plugin_delegate() may |
| 217 // return NULL. TODO(darin): how come there is only one per frame?!? | 206 // return NULL. TODO(darin): how come there is only one per frame?!? |
| 218 WebPluginDelegate* plugin_delegate() const { | 207 WebPluginDelegate* plugin_delegate() const { |
| 219 return plugin_delegate_; | 208 return plugin_delegate_; |
| 220 } | 209 } |
| 221 void set_plugin_delegate(WebPluginDelegate* plugin_delegate) { | 210 void set_plugin_delegate(WebPluginDelegate* plugin_delegate) { |
| 222 plugin_delegate_ = plugin_delegate; | 211 plugin_delegate_ = plugin_delegate; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 // Informs the WebFrame that the Frame is being closed, called by the | 269 // Informs the WebFrame that the Frame is being closed, called by the |
| 281 // WebFrameLoaderClient | 270 // WebFrameLoaderClient |
| 282 void Closing(); | 271 void Closing(); |
| 283 | 272 |
| 284 // See WebFrame.h for details. | 273 // See WebFrame.h for details. |
| 285 virtual void IncreaseMatchCount(int count, int request_id); | 274 virtual void IncreaseMatchCount(int count, int request_id); |
| 286 virtual void ReportFindInPageSelection(const WebKit::WebRect& selection_rect, | 275 virtual void ReportFindInPageSelection(const WebKit::WebRect& selection_rect, |
| 287 int active_match_ordinal, | 276 int active_match_ordinal, |
| 288 int request_id); | 277 int request_id); |
| 289 | 278 |
| 290 // Resource fetcher for downloading an alternate DNS error page. | |
| 291 scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_; | |
| 292 | |
| 293 // Used to check for leaks of this object. | 279 // Used to check for leaks of this object. |
| 294 static int live_object_count_; | 280 static int live_object_count_; |
| 295 | 281 |
| 296 WebFrameLoaderClient frame_loader_client_; | 282 WebFrameLoaderClient frame_loader_client_; |
| 297 | 283 |
| 298 // This is a factory for creating cancelable tasks for this frame that run | 284 // This is a factory for creating cancelable tasks for this frame that run |
| 299 // asynchronously in order to scope string matches during a find operation. | 285 // asynchronously in order to scope string matches during a find operation. |
| 300 ScopedRunnableMethodFactory<WebFrameImpl> scope_matches_factory_; | 286 ScopedRunnableMethodFactory<WebFrameImpl> scope_matches_factory_; |
| 301 | 287 |
| 302 // This is a weak pointer to our corresponding WebCore frame. A reference to | 288 // This is a weak pointer to our corresponding WebCore frame. A reference to |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 // The input fields that are interested in edit events and their associated | 398 // The input fields that are interested in edit events and their associated |
| 413 // listeners. | 399 // listeners. |
| 414 typedef HashMap<RefPtr<WebCore::HTMLInputElement>, | 400 typedef HashMap<RefPtr<WebCore::HTMLInputElement>, |
| 415 webkit_glue::PasswordAutocompleteListener*> PasswordListenerMap; | 401 webkit_glue::PasswordAutocompleteListener*> PasswordListenerMap; |
| 416 PasswordListenerMap password_listeners_; | 402 PasswordListenerMap password_listeners_; |
| 417 | 403 |
| 418 DISALLOW_COPY_AND_ASSIGN(WebFrameImpl); | 404 DISALLOW_COPY_AND_ASSIGN(WebFrameImpl); |
| 419 }; | 405 }; |
| 420 | 406 |
| 421 #endif // WEBKIT_GLUE_WEBFRAME_IMPL_H_ | 407 #endif // WEBKIT_GLUE_WEBFRAME_IMPL_H_ |
| OLD | NEW |