| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 2 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 3 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // WebFrame::Closing and then derefs the WebFrame and will cause it to be | 64 // WebFrame::Closing and then derefs the WebFrame and will cause it to be |
| 65 // deleted (unless an external someone is also holding a reference). | 65 // deleted (unless an external someone is also holding a reference). |
| 66 | 66 |
| 67 #include "config.h" | 67 #include "config.h" |
| 68 | 68 |
| 69 #include <algorithm> | 69 #include <algorithm> |
| 70 #include <string> | 70 #include <string> |
| 71 | 71 |
| 72 #include "HTMLFormElement.h" // need this before Document.h | 72 #include "HTMLFormElement.h" // need this before Document.h |
| 73 #include "Chrome.h" | 73 #include "Chrome.h" |
| 74 #include "ChromeClientChromium.h" | |
| 75 #include "ChromiumBridge.h" | 74 #include "ChromiumBridge.h" |
| 76 #include "ClipboardUtilitiesChromium.h" | 75 #include "ClipboardUtilitiesChromium.h" |
| 77 #include "Console.h" | 76 #include "Console.h" |
| 78 #include "Document.h" | 77 #include "Document.h" |
| 79 #include "DocumentFragment.h" // Only needed for ReplaceSelectionCommand.h :( | 78 #include "DocumentFragment.h" // Only needed for ReplaceSelectionCommand.h :( |
| 80 #include "DocumentLoader.h" | 79 #include "DocumentLoader.h" |
| 81 #include "DocumentMarker.h" | 80 #include "DocumentMarker.h" |
| 82 #include "DOMWindow.h" | 81 #include "DOMWindow.h" |
| 83 #include "Editor.h" | 82 #include "Editor.h" |
| 84 #include "EventHandler.h" | 83 #include "EventHandler.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 #include "webkit/api/public/WebRange.h" | 135 #include "webkit/api/public/WebRange.h" |
| 137 #include "webkit/api/public/WebRect.h" | 136 #include "webkit/api/public/WebRect.h" |
| 138 #include "webkit/api/public/WebScriptSource.h" | 137 #include "webkit/api/public/WebScriptSource.h" |
| 139 #include "webkit/api/public/WebSecurityOrigin.h" | 138 #include "webkit/api/public/WebSecurityOrigin.h" |
| 140 #include "webkit/api/public/WebSize.h" | 139 #include "webkit/api/public/WebSize.h" |
| 141 #include "webkit/api/public/WebURLError.h" | 140 #include "webkit/api/public/WebURLError.h" |
| 142 #include "webkit/api/public/WebVector.h" | 141 #include "webkit/api/public/WebVector.h" |
| 143 #include "webkit/api/src/DOMUtilitiesPrivate.h" | 142 #include "webkit/api/src/DOMUtilitiesPrivate.h" |
| 144 #include "webkit/api/src/PasswordAutocompleteListener.h" | 143 #include "webkit/api/src/PasswordAutocompleteListener.h" |
| 145 #include "webkit/api/src/WebDataSourceImpl.h" | 144 #include "webkit/api/src/WebDataSourceImpl.h" |
| 146 #include "webkit/glue/chrome_client_impl.h" | |
| 147 #include "webkit/glue/glue_util.h" | 145 #include "webkit/glue/glue_util.h" |
| 148 #include "webkit/glue/webframe_impl.h" | 146 #include "webkit/glue/webframe_impl.h" |
| 149 #include "webkit/glue/webview_impl.h" | 147 #include "webkit/glue/webview_impl.h" |
| 150 | 148 |
| 151 #if PLATFORM(LINUX) | 149 #if PLATFORM(LINUX) |
| 152 #include <gdk/gdk.h> | 150 #include <gdk/gdk.h> |
| 153 #endif | 151 #endif |
| 154 | 152 |
| 155 using WebCore::AtomicString; | 153 using WebCore::AtomicString; |
| 156 using WebCore::ChromeClientChromium; | |
| 157 using WebCore::ChromiumBridge; | 154 using WebCore::ChromiumBridge; |
| 158 using WebCore::Color; | 155 using WebCore::Color; |
| 159 using WebCore::Document; | 156 using WebCore::Document; |
| 160 using WebCore::DocumentFragment; | 157 using WebCore::DocumentFragment; |
| 161 using WebCore::DocumentLoader; | 158 using WebCore::DocumentLoader; |
| 162 using WebCore::ExceptionCode; | 159 using WebCore::ExceptionCode; |
| 163 using WebCore::GraphicsContext; | 160 using WebCore::GraphicsContext; |
| 164 using WebCore::HTMLFrameOwnerElement; | 161 using WebCore::HTMLFrameOwnerElement; |
| 165 using WebCore::HTMLInputElement; | 162 using WebCore::HTMLInputElement; |
| 166 using WebCore::Frame; | 163 using WebCore::Frame; |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 | 348 |
| 352 // WebFrame ------------------------------------------------------------------- | 349 // WebFrame ------------------------------------------------------------------- |
| 353 | 350 |
| 354 class WebFrameImpl::DeferredScopeStringMatches { | 351 class WebFrameImpl::DeferredScopeStringMatches { |
| 355 public: | 352 public: |
| 356 DeferredScopeStringMatches(WebFrameImpl* webframe, | 353 DeferredScopeStringMatches(WebFrameImpl* webframe, |
| 357 int identifier, | 354 int identifier, |
| 358 const WebString& search_text, | 355 const WebString& search_text, |
| 359 const WebFindOptions& options, | 356 const WebFindOptions& options, |
| 360 bool reset) | 357 bool reset) |
| 361 : timer_(this, &DeferredScopeStringMatches::DoTimeout), | 358 : ALLOW_THIS_IN_INITIALIZER_LIST( |
| 359 timer_(this, &DeferredScopeStringMatches::DoTimeout)), |
| 362 webframe_(webframe), | 360 webframe_(webframe), |
| 363 identifier_(identifier), | 361 identifier_(identifier), |
| 364 search_text_(search_text), | 362 search_text_(search_text), |
| 365 options_(options), | 363 options_(options), |
| 366 reset_(reset) { | 364 reset_(reset) { |
| 367 timer_.startOneShot(0.0); | 365 timer_.startOneShot(0.0); |
| 368 } | 366 } |
| 369 | 367 |
| 370 private: | 368 private: |
| 371 void DoTimeout(Timer<DeferredScopeStringMatches>*) { | 369 void DoTimeout(Timer<DeferredScopeStringMatches>*) { |
| (...skipping 1274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 | 1644 |
| 1647 // static | 1645 // static |
| 1648 WebFrameImpl* WebFrameImpl::FromFrame(WebCore::Frame* frame) { | 1646 WebFrameImpl* WebFrameImpl::FromFrame(WebCore::Frame* frame) { |
| 1649 if (!frame) | 1647 if (!frame) |
| 1650 return NULL; | 1648 return NULL; |
| 1651 return static_cast<WebFrameLoaderClient*>( | 1649 return static_cast<WebFrameLoaderClient*>( |
| 1652 frame->loader()->client())->webframe(); | 1650 frame->loader()->client())->webframe(); |
| 1653 } | 1651 } |
| 1654 | 1652 |
| 1655 WebViewImpl* WebFrameImpl::GetWebViewImpl() const { | 1653 WebViewImpl* WebFrameImpl::GetWebViewImpl() const { |
| 1656 if (!frame_ || !frame_->page()) | 1654 if (!frame_) |
| 1657 return NULL; | 1655 return NULL; |
| 1658 | 1656 |
| 1659 // There are cases where a Frame may outlive its associated Page. Get the | 1657 return WebViewImpl::FromPage(frame_->page()); |
| 1660 // WebViewImpl by accessing it indirectly through the Frame's Page so that we | |
| 1661 // don't have to worry about cleaning up the WebFrameImpl -> WebViewImpl | |
| 1662 // pointer. WebCore already clears the Frame's Page pointer when the Page is | |
| 1663 // destroyed by the WebViewImpl. | |
| 1664 return static_cast<ChromeClientImpl*>( | |
| 1665 frame_->page()->chrome()->client())->webview(); | |
| 1666 } | 1658 } |
| 1667 | 1659 |
| 1668 WebDataSourceImpl* WebFrameImpl::GetDataSourceImpl() const { | 1660 WebDataSourceImpl* WebFrameImpl::GetDataSourceImpl() const { |
| 1669 return static_cast<WebDataSourceImpl*>(dataSource()); | 1661 return static_cast<WebDataSourceImpl*>(dataSource()); |
| 1670 } | 1662 } |
| 1671 | 1663 |
| 1672 WebDataSourceImpl* WebFrameImpl::GetProvisionalDataSourceImpl() const { | 1664 WebDataSourceImpl* WebFrameImpl::GetProvisionalDataSourceImpl() const { |
| 1673 return static_cast<WebDataSourceImpl*>(provisionalDataSource()); | 1665 return static_cast<WebDataSourceImpl*>(provisionalDataSource()); |
| 1674 } | 1666 } |
| 1675 | 1667 |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1916 | 1908 |
| 1917 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); | 1909 SecurityOrigin* security_origin = frame_->document()->securityOrigin(); |
| 1918 | 1910 |
| 1919 if (!frame_->redirectScheduler()->locationChangePending()) { | 1911 if (!frame_->redirectScheduler()->locationChangePending()) { |
| 1920 frame_->loader()->stopAllLoaders(); | 1912 frame_->loader()->stopAllLoaders(); |
| 1921 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); | 1913 frame_->loader()->begin(frame_->loader()->url(), true, security_origin); |
| 1922 frame_->loader()->write(script_result); | 1914 frame_->loader()->write(script_result); |
| 1923 frame_->loader()->end(); | 1915 frame_->loader()->end(); |
| 1924 } | 1916 } |
| 1925 } | 1917 } |
| OLD | NEW |