| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "HTMLMetaElement.h" | 26 #include "HTMLMetaElement.h" |
| 27 #include "HTMLOptionElement.h" | 27 #include "HTMLOptionElement.h" |
| 28 #include "HTMLNames.h" | 28 #include "HTMLNames.h" |
| 29 #include "KURL.h" | 29 #include "KURL.h" |
| 30 MSVC_POP_WARNING(); | 30 MSVC_POP_WARNING(); |
| 31 #undef LOG | 31 #undef LOG |
| 32 | 32 |
| 33 #include "base/string_util.h" | 33 #include "base/string_util.h" |
| 34 // TODO(yaar) Eventually should not depend on api/src. | 34 // TODO(yaar) Eventually should not depend on api/src. |
| 35 #include "webkit/api/src/DOMUtilitiesPrivate.h" | 35 #include "webkit/api/src/DOMUtilitiesPrivate.h" |
| 36 #include "webkit/api/src/WebFrameImpl.h" |
| 37 #include "webkit/api/src/WebViewImpl.h" |
| 36 #include "webkit/glue/dom_operations.h" | 38 #include "webkit/glue/dom_operations.h" |
| 37 #include "webkit/glue/dom_operations_private.h" | 39 #include "webkit/glue/dom_operations_private.h" |
| 38 #include "webkit/glue/form_data.h" | 40 #include "webkit/glue/form_data.h" |
| 39 #include "webkit/glue/glue_util.h" | 41 #include "webkit/glue/glue_util.h" |
| 40 #include "webkit/glue/password_autocomplete_listener_impl.h" | 42 #include "webkit/glue/password_autocomplete_listener_impl.h" |
| 41 #include "webkit/glue/webframe_impl.h" | |
| 42 #include "webkit/glue/webview_impl.h" | |
| 43 | 43 |
| 44 using WebCore::String; | 44 using WebCore::String; |
| 45 using WebKit::FrameLoaderClientImpl; |
| 45 using WebKit::WebFrame; | 46 using WebKit::WebFrame; |
| 47 using WebKit::WebFrameImpl; |
| 46 using WebKit::WebView; | 48 using WebKit::WebView; |
| 47 | 49 |
| 48 namespace { | 50 namespace { |
| 49 | 51 |
| 50 // Structure for storage the unique set of all savable resource links for | 52 // Structure for storage the unique set of all savable resource links for |
| 51 // making sure that no duplicated resource link in final result. The consumer | 53 // making sure that no duplicated resource link in final result. The consumer |
| 52 // of the SavableResourcesUniqueCheck is responsible for keeping these pointers | 54 // of the SavableResourcesUniqueCheck is responsible for keeping these pointers |
| 53 // valid for the lifetime of the SavableResourcesUniqueCheck instance. | 55 // valid for the lifetime of the SavableResourcesUniqueCheck instance. |
| 54 struct SavableResourcesUniqueCheck { | 56 struct SavableResourcesUniqueCheck { |
| 55 // Unique set of all sub resource links. | 57 // Unique set of all sub resource links. |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 // Attach autocomplete listener to enable selecting alternate logins. | 340 // Attach autocomplete listener to enable selecting alternate logins. |
| 339 // First, get pointers to username element. | 341 // First, get pointers to username element. |
| 340 WebCore::HTMLInputElement* username_element = | 342 WebCore::HTMLInputElement* username_element = |
| 341 form_elements->input_elements[data.basic_data.elements[0]].get(); | 343 form_elements->input_elements[data.basic_data.elements[0]].get(); |
| 342 | 344 |
| 343 // Get pointer to password element. (We currently only support single | 345 // Get pointer to password element. (We currently only support single |
| 344 // password forms). | 346 // password forms). |
| 345 WebCore::HTMLInputElement* password_element = | 347 WebCore::HTMLInputElement* password_element = |
| 346 form_elements->input_elements[data.basic_data.elements[1]].get(); | 348 form_elements->input_elements[data.basic_data.elements[1]].get(); |
| 347 | 349 |
| 348 WebFrameLoaderClient* frame_loader_client = | 350 FrameLoaderClientImpl* frame_loader_client = |
| 349 static_cast<WebFrameLoaderClient*>(username_element->document()-> | 351 static_cast<FrameLoaderClientImpl*>(username_element->document()-> |
| 350 frame()->loader()->client()); | 352 frame()->loader()->client()); |
| 351 WebFrameImpl* webframe_impl = frame_loader_client->webframe(); | 353 WebFrameImpl* webframe_impl = frame_loader_client->webFrame(); |
| 352 webframe_impl->RegisterPasswordListener( | 354 webframe_impl->registerPasswordListener( |
| 353 username_element, | 355 username_element, |
| 354 new PasswordAutocompleteListenerImpl( | 356 new PasswordAutocompleteListenerImpl( |
| 355 new HTMLInputDelegate(username_element), | 357 new HTMLInputDelegate(username_element), |
| 356 new HTMLInputDelegate(password_element), | 358 new HTMLInputDelegate(password_element), |
| 357 data)); | 359 data)); |
| 358 } | 360 } |
| 359 } | 361 } |
| 360 | 362 |
| 361 WebFrameImpl* GetWebFrameImplFromElement(WebCore::Element* element, | 363 WebFrameImpl* GetWebFrameImplFromElement(WebCore::Element* element, |
| 362 bool* is_frame_element) { | 364 bool* is_frame_element) { |
| 363 *is_frame_element = false; | 365 *is_frame_element = false; |
| 364 if (element->hasTagName(WebCore::HTMLNames::iframeTag) || | 366 if (element->hasTagName(WebCore::HTMLNames::iframeTag) || |
| 365 element->hasTagName(WebCore::HTMLNames::frameTag)) { | 367 element->hasTagName(WebCore::HTMLNames::frameTag)) { |
| 366 *is_frame_element = true; | 368 *is_frame_element = true; |
| 367 if (element->isFrameOwnerElement()) { | 369 if (element->isFrameOwnerElement()) { |
| 368 // Check whether this frame has content. | 370 // Check whether this frame has content. |
| 369 WebCore::HTMLFrameOwnerElement* frame_element = | 371 WebCore::HTMLFrameOwnerElement* frame_element = |
| 370 static_cast<WebCore::HTMLFrameOwnerElement*>(element); | 372 static_cast<WebCore::HTMLFrameOwnerElement*>(element); |
| 371 WebCore::Frame* content_frame = frame_element->contentFrame(); | 373 WebCore::Frame* content_frame = frame_element->contentFrame(); |
| 372 return WebFrameImpl::FromFrame(content_frame); | 374 return WebFrameImpl::fromFrame(content_frame); |
| 373 } | 375 } |
| 374 } | 376 } |
| 375 return NULL; | 377 return NULL; |
| 376 } | 378 } |
| 377 | 379 |
| 378 const WebCore::AtomicString* GetSubResourceLinkFromElement( | 380 const WebCore::AtomicString* GetSubResourceLinkFromElement( |
| 379 const WebCore::Element* element) { | 381 const WebCore::Element* element) { |
| 380 const WebCore::QualifiedName* attribute_name = NULL; | 382 const WebCore::QualifiedName* attribute_name = NULL; |
| 381 if (element->hasTagName(WebCore::HTMLNames::imgTag) || | 383 if (element->hasTagName(WebCore::HTMLNames::imgTag) || |
| 382 element->hasTagName(WebCore::HTMLNames::scriptTag) || | 384 element->hasTagName(WebCore::HTMLNames::scriptTag) || |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 WebCore::Frame* frame = static_cast<WebFrameImpl*>(web_frame)->frame(); | 755 WebCore::Frame* frame = static_cast<WebFrameImpl*>(web_frame)->frame(); |
| 754 WebCore::AnimationController* controller = frame->animation(); | 756 WebCore::AnimationController* controller = frame->animation(); |
| 755 if (!controller) | 757 if (!controller) |
| 756 return -1; | 758 return -1; |
| 757 | 759 |
| 758 return controller->numberOfActiveAnimations(); | 760 return controller->numberOfActiveAnimations(); |
| 759 } | 761 } |
| 760 | 762 |
| 761 | 763 |
| 762 } // webkit_glue | 764 } // webkit_glue |
| OLD | NEW |