| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 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 are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "WebAutofillClient.h" | 45 #include "WebAutofillClient.h" |
| 46 #include "WebColorChooser.h" | 46 #include "WebColorChooser.h" |
| 47 #include "WebColorSuggestion.h" | 47 #include "WebColorSuggestion.h" |
| 48 #include "WebConsoleMessage.h" | 48 #include "WebConsoleMessage.h" |
| 49 #include "WebCursorInfo.h" | 49 #include "WebCursorInfo.h" |
| 50 #include "WebFileChooserCompletionImpl.h" | 50 #include "WebFileChooserCompletionImpl.h" |
| 51 #include "WebFrameClient.h" | 51 #include "WebFrameClient.h" |
| 52 #include "WebFrameImpl.h" | 52 #include "WebFrameImpl.h" |
| 53 #include "WebInputElement.h" | 53 #include "WebInputElement.h" |
| 54 #include "WebInputEvent.h" | 54 #include "WebInputEvent.h" |
| 55 #include "WebInputEventConversion.h" |
| 55 #include "WebKit.h" | 56 #include "WebKit.h" |
| 56 #include "WebNode.h" | 57 #include "WebNode.h" |
| 57 #include "WebPasswordGeneratorClient.h" | 58 #include "WebPasswordGeneratorClient.h" |
| 58 #include "WebPlugin.h" | 59 #include "WebPlugin.h" |
| 59 #include "WebPluginContainerImpl.h" | 60 #include "WebPluginContainerImpl.h" |
| 60 #include "WebPopupMenuImpl.h" | 61 #include "WebPopupMenuImpl.h" |
| 61 #include "WebPopupMenuInfo.h" | 62 #include "WebPopupMenuInfo.h" |
| 62 #include "WebPopupType.h" | 63 #include "WebPopupType.h" |
| 63 #include "WebSettings.h" | 64 #include "WebSettings.h" |
| 64 #include "WebSettingsImpl.h" | 65 #include "WebSettingsImpl.h" |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 { | 977 { |
| 977 if (!m_webView->autofillClient()) | 978 if (!m_webView->autofillClient()) |
| 978 return; | 979 return; |
| 979 WebVector<WebNode> elementVector(static_cast<size_t>(elements.size())); | 980 WebVector<WebNode> elementVector(static_cast<size_t>(elements.size())); |
| 980 size_t elementsCount = elements.size(); | 981 size_t elementsCount = elements.size(); |
| 981 for (size_t i = 0; i < elementsCount; ++i) | 982 for (size_t i = 0; i < elementsCount; ++i) |
| 982 elementVector[i] = elements[i]; | 983 elementVector[i] = elements[i]; |
| 983 m_webView->autofillClient()->didAssociateFormControls(elementVector); | 984 m_webView->autofillClient()->didAssociateFormControls(elementVector); |
| 984 } | 985 } |
| 985 | 986 |
| 987 bool ChromeClientImpl::doTextFieldCommandFromEvent(HTMLInputElement* inputElemen
t, KeyboardEvent* event) |
| 988 { |
| 989 if (!m_webView->autofillClient()) |
| 990 return false; |
| 991 |
| 992 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(inpu
tElement), WebKeyboardEventBuilder(*event)); |
| 993 |
| 994 // The Mac code appears to use this method as a hook to implement special |
| 995 // keyboard commands specific to Safari's auto-fill implementation. We |
| 996 // just return false to allow the default action. |
| 997 return false; |
| 998 } |
| 999 |
| 1000 void ChromeClientImpl::textDidChangeInTextField(HTMLInputElement* inputElement) |
| 1001 { |
| 1002 if (!m_webView->autofillClient()) |
| 1003 return; |
| 1004 m_webView->autofillClient()->textFieldDidChange(WebInputElement(inputElement
)); |
| 1005 } |
| 1006 |
| 1007 void ChromeClientImpl::textFieldDidEndEditing(HTMLInputElement* inputElement) |
| 1008 { |
| 1009 if (m_webView->autofillClient()) |
| 1010 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(inpu
tElement)); |
| 1011 |
| 1012 // Notification that focus was lost. Be careful with this, it's also sent |
| 1013 // when the page is being closed. |
| 1014 |
| 1015 // Hide any showing popup. |
| 1016 m_webView->hideAutofillPopup(); |
| 1017 } |
| 1018 |
| 986 #if ENABLE(NAVIGATOR_CONTENT_UTILS) | 1019 #if ENABLE(NAVIGATOR_CONTENT_UTILS) |
| 987 PassOwnPtr<NavigatorContentUtilsClientImpl> NavigatorContentUtilsClientImpl::cre
ate(WebViewImpl* webView) | 1020 PassOwnPtr<NavigatorContentUtilsClientImpl> NavigatorContentUtilsClientImpl::cre
ate(WebViewImpl* webView) |
| 988 { | 1021 { |
| 989 return adoptPtr(new NavigatorContentUtilsClientImpl(webView)); | 1022 return adoptPtr(new NavigatorContentUtilsClientImpl(webView)); |
| 990 } | 1023 } |
| 991 | 1024 |
| 992 NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl(WebViewImpl* we
bView) | 1025 NavigatorContentUtilsClientImpl::NavigatorContentUtilsClientImpl(WebViewImpl* we
bView) |
| 993 : m_webView(webView) | 1026 : m_webView(webView) |
| 994 { | 1027 { |
| 995 } | 1028 } |
| 996 | 1029 |
| 997 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche
me, const String& baseURL, const String& url, const String& title) | 1030 void NavigatorContentUtilsClientImpl::registerProtocolHandler(const String& sche
me, const String& baseURL, const String& url, const String& title) |
| 998 { | 1031 { |
| 999 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); | 1032 m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title); |
| 1000 } | 1033 } |
| 1001 #endif | 1034 #endif |
| 1002 | 1035 |
| 1003 } // namespace blink | 1036 } // namespace blink |
| OLD | NEW |