Changeset 91004 in webkit
- Timestamp:
- Jul 14, 2011 9:42:50 AM (13 years ago)
- Location:
- trunk/Source/WebKit/chromium
- Files:
-
- 8 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/chromium/ChangeLog
r90999 r91004 1 2011-07-14 Ilya Sherman <isherman@chromium.org> 2 3 Rename AutoFill -> Autofill and autoFill -> autofill 4 https://bugs.webkit.org/show_bug.cgi?id=64333 5 http://code.google.com/p/chromium/issues/detail?id=72758 6 7 Reviewed by Darin Fisher. 8 9 * WebKit.gyp: 10 * public/WebAutofillClient.h: 11 (WebKit::WebAutofillClient::didAcceptAutofillSuggestion): 12 (WebKit::WebAutofillClient::didSelectAutofillSuggestion): 13 (WebKit::WebAutofillClient::didClearAutofillSelection): 14 (WebKit::WebAutofillClient::removeAutocompleteSuggestion): 15 (WebKit::WebAutofillClient::textFieldDidBeginEditing): 16 (WebKit::WebAutofillClient::textFieldDidEndEditing): 17 (WebKit::WebAutofillClient::textFieldDidChange): 18 (WebKit::WebAutofillClient::textFieldDidReceiveKeyDown): 19 (WebKit::WebAutofillClient::~WebAutofillClient): 20 * public/WebNode.h: 21 * public/WebView.h: 22 * src/AutofillPopupMenuClient.cpp: 23 (WebKit::AutofillPopupMenuClient::AutofillPopupMenuClient): 24 (WebKit::AutofillPopupMenuClient::~AutofillPopupMenuClient): 25 (WebKit::AutofillPopupMenuClient::getSuggestionsCount): 26 (WebKit::AutofillPopupMenuClient::getSuggestion): 27 (WebKit::AutofillPopupMenuClient::getLabel): 28 (WebKit::AutofillPopupMenuClient::getIcon): 29 (WebKit::AutofillPopupMenuClient::removeSuggestionAtIndex): 30 (WebKit::AutofillPopupMenuClient::canRemoveSuggestionAtIndex): 31 (WebKit::AutofillPopupMenuClient::valueChanged): 32 (WebKit::AutofillPopupMenuClient::selectionChanged): 33 (WebKit::AutofillPopupMenuClient::selectionCleared): 34 (WebKit::AutofillPopupMenuClient::itemText): 35 (WebKit::AutofillPopupMenuClient::itemLabel): 36 (WebKit::AutofillPopupMenuClient::itemIcon): 37 (WebKit::AutofillPopupMenuClient::itemIsEnabled): 38 (WebKit::AutofillPopupMenuClient::itemStyle): 39 (WebKit::AutofillPopupMenuClient::menuStyle): 40 (WebKit::AutofillPopupMenuClient::clientPaddingLeft): 41 (WebKit::AutofillPopupMenuClient::clientPaddingRight): 42 (WebKit::AutofillPopupMenuClient::popupDidHide): 43 (WebKit::AutofillPopupMenuClient::itemIsSeparator): 44 (WebKit::AutofillPopupMenuClient::itemIsWarning): 45 (WebKit::AutofillPopupMenuClient::setTextFromItem): 46 (WebKit::AutofillPopupMenuClient::fontSelector): 47 (WebKit::AutofillPopupMenuClient::hostWindow): 48 (WebKit::AutofillPopupMenuClient::createScrollbar): 49 (WebKit::AutofillPopupMenuClient::initialize): 50 (WebKit::AutofillPopupMenuClient::setSuggestions): 51 (WebKit::AutofillPopupMenuClient::convertListIndexToInternalIndex): 52 (WebKit::AutofillPopupMenuClient::getWebView): 53 (WebKit::AutofillPopupMenuClient::textFieldStyle): 54 * src/AutofillPopupMenuClient.h: 55 (WebKit::AutofillPopupMenuClient::itemToolTip): 56 (WebKit::AutofillPopupMenuClient::itemAccessibilityText): 57 (WebKit::AutofillPopupMenuClient::clientInsetLeft): 58 (WebKit::AutofillPopupMenuClient::clientInsetRight): 59 (WebKit::AutofillPopupMenuClient::listSize): 60 (WebKit::AutofillPopupMenuClient::selectedIndex): 61 (WebKit::AutofillPopupMenuClient::itemIsLabel): 62 (WebKit::AutofillPopupMenuClient::itemIsSelected): 63 (WebKit::AutofillPopupMenuClient::shouldPopOver): 64 (WebKit::AutofillPopupMenuClient::valueShouldChangeOnHotTrack): 65 (WebKit::AutofillPopupMenuClient::getTextField): 66 (WebKit::AutofillPopupMenuClient::getSelectedIndex): 67 (WebKit::AutofillPopupMenuClient::setSelectedIndex): 68 * src/EditorClientImpl.cpp: 69 (WebKit::EditorClientImpl::textFieldDidBeginEditing): 70 (WebKit::EditorClientImpl::textFieldDidEndEditing): 71 (WebKit::EditorClientImpl::textDidChangeInTextField): 72 (WebKit::EditorClientImpl::doAutofill): 73 (WebKit::EditorClientImpl::doTextFieldCommandFromEvent): 74 * src/WebInputElement.cpp: 75 (WebKit::WebInputElement::setAutofilled): 76 * src/WebViewImpl.cpp: 77 (WebKit::WebViewImpl::setAutofillClient): 78 (WebKit::WebViewImpl::WebViewImpl): 79 (WebKit::WebViewImpl::mouseDown): 80 (WebKit::WebViewImpl::autocompleteHandleKeyEvent): 81 (WebKit::WebViewImpl::hideAutofillPopup): 82 (WebKit::WebViewImpl::setFocus): 83 (WebKit::WebViewImpl::applyAutofillSuggestions): 84 (WebKit::WebViewImpl::hidePopups): 85 (WebKit::WebViewImpl::refreshAutofillPopup): 86 * src/WebViewImpl.h: 87 (WebKit::WebViewImpl::autofillClient): 88 (WebKit::WebViewImpl::autofillPopupDidHide): 89 1 90 2011-07-14 Yury Semikhatsky <yurys@chromium.org> 2 91 -
trunk/Source/WebKit/chromium/WebKit.gyp
r90836 r91004 108 108 'public/WebAudioBus.h', 109 109 'public/WebAudioDevice.h', 110 'public/WebAuto FillClient.h',110 'public/WebAutofillClient.h', 111 111 'public/WebBindings.h', 112 112 'public/WebBlobData.h', … … 311 311 'src/AudioDestinationChromium.cpp', 312 312 'src/AudioDestinationChromium.h', 313 'src/Auto FillPopupMenuClient.cpp',314 'src/Auto FillPopupMenuClient.h',313 'src/AutofillPopupMenuClient.cpp', 314 'src/AutofillPopupMenuClient.h', 315 315 'src/BackForwardListChromium.cpp', 316 316 'src/BackForwardListChromium.h', -
trunk/Source/WebKit/chromium/public/WebAutofillClient.h
r91003 r91004 29 29 */ 30 30 31 #ifndef WebAuto FillClient_h32 #define WebAuto FillClient_h31 #ifndef WebAutofillClient_h 32 #define WebAutofillClient_h 33 33 34 34 namespace WebKit { … … 39 39 class WebString; 40 40 41 class WebAuto FillClient {41 class WebAutofillClient { 42 42 public: 43 // Informs the browser that the user has accepted an Auto Fill suggestion for44 // a WebNode. |uniqueID| is used as a key into the set of Auto Fill profiles,43 // Informs the browser that the user has accepted an Autofill suggestion for 44 // a WebNode. |uniqueID| is used as a key into the set of Autofill profiles, 45 45 // and should never be negative. If it is 0, then the suggestion is an 46 46 // Autocomplete suggestion; and |value| stores the suggested text. |index| 47 47 // is an index of the selected suggestion in the list of suggestions provided 48 48 // by the client. 49 virtual void didAcceptAuto FillSuggestion(const WebNode&,49 virtual void didAcceptAutofillSuggestion(const WebNode&, 50 50 const WebString& value, 51 51 const WebString& label, … … 53 53 unsigned index) { } 54 54 55 // Informs the browser that the user has selected an Auto Fill suggestion for55 // Informs the browser that the user has selected an Autofill suggestion for 56 56 // a WebNode. This happens when the user hovers over a suggestion or uses 57 57 // the arrow keys to navigate to a suggestion. 58 virtual void didSelectAuto FillSuggestion(const WebNode&,58 virtual void didSelectAutofillSuggestion(const WebNode&, 59 59 const WebString& name, 60 60 const WebString& label, … … 62 62 63 63 // Informs the browser that the user has cleared the selection from the 64 // Auto Fill suggestions popup.This happens when a user uses the arrow64 // Autofill suggestions popup. This happens when a user uses the arrow 65 65 // keys to navigate outside the range of possible selections. 66 virtual void didClearAuto FillSelection(const WebNode&) { }66 virtual void didClearAutofillSelection(const WebNode&) { } 67 67 68 68 // Instructs the browser to remove the Autocomplete entry specified from … … 78 78 79 79 protected: 80 ~WebAuto FillClient() { }80 ~WebAutofillClient() { } 81 81 }; 82 82 -
trunk/Source/WebKit/chromium/public/WebNode.h
r84520 r91004 35 35 #include "WebPrivatePtr.h" 36 36 #include "WebString.h" 37 38 // TODO(isherman): Remove this once the Chromium side is updated. 39 #define CRBUG_72758_FIXED 37 40 38 41 namespace WebCore { class Node; } -
trunk/Source/WebKit/chromium/public/WebView.h
r86047 r91004 41 41 42 42 class WebAccessibilityObject; 43 class WebAuto FillClient;43 class WebAutofillClient; 44 44 class WebDevToolsAgent; 45 45 class WebDevToolsAgentClient; … … 96 96 97 97 // Initializes the various client interfaces. 98 virtual void setAuto FillClient(WebAutoFillClient*) = 0;98 virtual void setAutofillClient(WebAutofillClient*) = 0; 99 99 virtual void setDevToolsAgentClient(WebDevToolsAgentClient*) = 0; 100 100 virtual void setPermissionClient(WebPermissionClient*) = 0; … … 278 278 279 279 280 // Auto Fill -----------------------------------------------------------281 282 // Notifies the WebView that Auto Fill suggestions are available for a node.280 // Autofill ----------------------------------------------------------- 281 282 // Notifies the WebView that Autofill suggestions are available for a node. 283 283 // |uniqueIDs| is a vector of IDs that represent the unique ID of each 284 // Auto Fill profile in the suggestions popup.If a unique ID is 0, then the285 // corresponding suggestion comes from Autocomplete rather than Auto Fill.284 // Autofill profile in the suggestions popup. If a unique ID is 0, then the 285 // corresponding suggestion comes from Autocomplete rather than Autofill. 286 286 // If a unique ID is negative, then the corresponding "suggestion" is 287 // actually a user-facing warning, e.g. explaining why Auto Fill is287 // actually a user-facing warning, e.g. explaining why Autofill is 288 288 // unavailable for the current form. 289 virtual void applyAuto FillSuggestions(289 virtual void applyAutofillSuggestions( 290 290 const WebNode&, 291 291 const WebVector<WebString>& names, -
trunk/Source/WebKit/chromium/src/AutofillPopupMenuClient.cpp
r91003 r91004 1 1 /* 2 * Copyright (C) 201 0Google Inc. All rights reserved.2 * Copyright (C) 2011 Google Inc. All rights reserved. 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 30 30 31 31 #include "config.h" 32 #include "Auto FillPopupMenuClient.h"32 #include "AutofillPopupMenuClient.h" 33 33 34 34 #include "CSSFontSelector.h" … … 41 41 #include "Page.h" 42 42 #include "RenderTheme.h" 43 #include "WebAuto FillClient.h"43 #include "WebAutofillClient.h" 44 44 #include "WebNode.h" 45 45 #include "WebString.h" … … 52 52 namespace WebKit { 53 53 54 Auto FillPopupMenuClient::AutoFillPopupMenuClient()54 AutofillPopupMenuClient::AutofillPopupMenuClient() 55 55 : m_separatorIndex(-1) 56 56 , m_selectedIndex(-1) … … 59 59 } 60 60 61 Auto FillPopupMenuClient::~AutoFillPopupMenuClient()62 { 63 } 64 65 unsigned Auto FillPopupMenuClient::getSuggestionsCount() const61 AutofillPopupMenuClient::~AutofillPopupMenuClient() 62 { 63 } 64 65 unsigned AutofillPopupMenuClient::getSuggestionsCount() const 66 66 { 67 67 return m_names.size() + ((m_separatorIndex == -1) ? 0 : 1); 68 68 } 69 69 70 WebString Auto FillPopupMenuClient::getSuggestion(unsigned listIndex) const70 WebString AutofillPopupMenuClient::getSuggestion(unsigned listIndex) const 71 71 { 72 72 int index = convertListIndexToInternalIndex(listIndex); … … 78 78 } 79 79 80 WebString Auto FillPopupMenuClient::getLabel(unsigned listIndex) const80 WebString AutofillPopupMenuClient::getLabel(unsigned listIndex) const 81 81 { 82 82 int index = convertListIndexToInternalIndex(listIndex); … … 88 88 } 89 89 90 WebString Auto FillPopupMenuClient::getIcon(unsigned listIndex) const90 WebString AutofillPopupMenuClient::getIcon(unsigned listIndex) const 91 91 { 92 92 int index = convertListIndexToInternalIndex(listIndex); … … 98 98 } 99 99 100 void Auto FillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex)100 void AutofillPopupMenuClient::removeSuggestionAtIndex(unsigned listIndex) 101 101 { 102 102 if (!canRemoveSuggestionAtIndex(listIndex)) … … 117 117 } 118 118 119 bool Auto FillPopupMenuClient::canRemoveSuggestionAtIndex(unsigned listIndex)119 bool AutofillPopupMenuClient::canRemoveSuggestionAtIndex(unsigned listIndex) 120 120 { 121 121 // Only allow deletion of items before the separator that have unique id 0 … … 125 125 } 126 126 127 void Auto FillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents)127 void AutofillPopupMenuClient::valueChanged(unsigned listIndex, bool fireEvents) 128 128 { 129 129 WebViewImpl* webView = getWebView(); … … 136 136 ASSERT(listIndex < m_names.size()); 137 137 138 webView->auto FillClient()->didAcceptAutoFillSuggestion(WebNode(getTextField()),138 webView->autofillClient()->didAcceptAutofillSuggestion(WebNode(getTextField()), 139 139 m_names[listIndex], 140 140 m_labels[listIndex], … … 143 143 } 144 144 145 void Auto FillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEvents)145 void AutofillPopupMenuClient::selectionChanged(unsigned listIndex, bool fireEvents) 146 146 { 147 147 WebViewImpl* webView = getWebView(); … … 154 154 ASSERT(listIndex < m_names.size()); 155 155 156 webView->auto FillClient()->didSelectAutoFillSuggestion(WebNode(getTextField()),156 webView->autofillClient()->didSelectAutofillSuggestion(WebNode(getTextField()), 157 157 m_names[listIndex], 158 158 m_labels[listIndex], … … 160 160 } 161 161 162 void Auto FillPopupMenuClient::selectionCleared()162 void AutofillPopupMenuClient::selectionCleared() 163 163 { 164 164 WebViewImpl* webView = getWebView(); 165 165 if (webView) 166 webView->auto FillClient()->didClearAutoFillSelection(WebNode(getTextField()));167 } 168 169 String Auto FillPopupMenuClient::itemText(unsigned listIndex) const166 webView->autofillClient()->didClearAutofillSelection(WebNode(getTextField())); 167 } 168 169 String AutofillPopupMenuClient::itemText(unsigned listIndex) const 170 170 { 171 171 return getSuggestion(listIndex); 172 172 } 173 173 174 String Auto FillPopupMenuClient::itemLabel(unsigned listIndex) const174 String AutofillPopupMenuClient::itemLabel(unsigned listIndex) const 175 175 { 176 176 return getLabel(listIndex); 177 177 } 178 178 179 String Auto FillPopupMenuClient::itemIcon(unsigned listIndex) const179 String AutofillPopupMenuClient::itemIcon(unsigned listIndex) const 180 180 { 181 181 return getIcon(listIndex); 182 182 } 183 183 184 bool Auto FillPopupMenuClient::itemIsEnabled(unsigned listIndex) const184 bool AutofillPopupMenuClient::itemIsEnabled(unsigned listIndex) const 185 185 { 186 186 return !itemIsWarning(listIndex); 187 187 } 188 188 189 PopupMenuStyle Auto FillPopupMenuClient::itemStyle(unsigned listIndex) const189 PopupMenuStyle AutofillPopupMenuClient::itemStyle(unsigned listIndex) const 190 190 { 191 191 return itemIsWarning(listIndex) ? *m_warningStyle : *m_regularStyle; 192 192 } 193 193 194 PopupMenuStyle Auto FillPopupMenuClient::menuStyle() const194 PopupMenuStyle AutofillPopupMenuClient::menuStyle() const 195 195 { 196 196 return *m_regularStyle; 197 197 } 198 198 199 int Auto FillPopupMenuClient::clientPaddingLeft() const199 int AutofillPopupMenuClient::clientPaddingLeft() const 200 200 { 201 201 // Bug http://crbug.com/7708 seems to indicate the style can be 0. … … 207 207 } 208 208 209 int Auto FillPopupMenuClient::clientPaddingRight() const209 int AutofillPopupMenuClient::clientPaddingRight() const 210 210 { 211 211 // Bug http://crbug.com/7708 seems to indicate the style can be 0. … … 217 217 } 218 218 219 void Auto FillPopupMenuClient::popupDidHide()219 void AutofillPopupMenuClient::popupDidHide() 220 220 { 221 221 WebViewImpl* webView = getWebView(); … … 223 223 return; 224 224 225 webView->auto FillPopupDidHide();226 webView->auto FillClient()->didClearAutoFillSelection(WebNode(getTextField()));227 } 228 229 bool Auto FillPopupMenuClient::itemIsSeparator(unsigned listIndex) const225 webView->autofillPopupDidHide(); 226 webView->autofillClient()->didClearAutofillSelection(WebNode(getTextField())); 227 } 228 229 bool AutofillPopupMenuClient::itemIsSeparator(unsigned listIndex) const 230 230 { 231 231 return (m_separatorIndex != -1 && static_cast<unsigned>(m_separatorIndex) == listIndex); 232 232 } 233 233 234 bool Auto FillPopupMenuClient::itemIsWarning(unsigned listIndex) const234 bool AutofillPopupMenuClient::itemIsWarning(unsigned listIndex) const 235 235 { 236 236 int index = convertListIndexToInternalIndex(listIndex); … … 242 242 } 243 243 244 void Auto FillPopupMenuClient::setTextFromItem(unsigned listIndex)244 void AutofillPopupMenuClient::setTextFromItem(unsigned listIndex) 245 245 { 246 246 m_textField->setValue(getSuggestion(listIndex)); 247 247 } 248 248 249 FontSelector* Auto FillPopupMenuClient::fontSelector() const249 FontSelector* AutofillPopupMenuClient::fontSelector() const 250 250 { 251 251 return m_textField->document()->styleSelector()->fontSelector(); 252 252 } 253 253 254 HostWindow* Auto FillPopupMenuClient::hostWindow() const254 HostWindow* AutofillPopupMenuClient::hostWindow() const 255 255 { 256 256 return m_textField->document()->view()->hostWindow(); 257 257 } 258 258 259 PassRefPtr<Scrollbar> Auto FillPopupMenuClient::createScrollbar(259 PassRefPtr<Scrollbar> AutofillPopupMenuClient::createScrollbar( 260 260 ScrollableArea* scrollableArea, 261 261 ScrollbarOrientation orientation, … … 265 265 } 266 266 267 void Auto FillPopupMenuClient::initialize(267 void AutofillPopupMenuClient::initialize( 268 268 HTMLInputElement* textField, 269 269 const WebVector<WebString>& names, … … 282 282 283 283 // The suggestions must be set before initializing the 284 // Auto FillPopupMenuClient.284 // AutofillPopupMenuClient. 285 285 setSuggestions(names, labels, icons, uniqueIDs, separatorIndex); 286 286 … … 311 311 } 312 312 313 void Auto FillPopupMenuClient::setSuggestions(const WebVector<WebString>& names,313 void AutofillPopupMenuClient::setSuggestions(const WebVector<WebString>& names, 314 314 const WebVector<WebString>& labels, 315 315 const WebVector<WebString>& icons, … … 340 340 } 341 341 342 int Auto FillPopupMenuClient::convertListIndexToInternalIndex(unsigned listIndex) const342 int AutofillPopupMenuClient::convertListIndexToInternalIndex(unsigned listIndex) const 343 343 { 344 344 if (listIndex == static_cast<unsigned>(m_separatorIndex)) … … 350 350 } 351 351 352 WebViewImpl* Auto FillPopupMenuClient::getWebView() const352 WebViewImpl* AutofillPopupMenuClient::getWebView() const 353 353 { 354 354 Frame* frame = m_textField->document()->frame(); … … 363 363 } 364 364 365 RenderStyle* Auto FillPopupMenuClient::textFieldStyle() const365 RenderStyle* AutofillPopupMenuClient::textFieldStyle() const 366 366 { 367 367 RenderStyle* style = m_textField->computedStyle(); -
trunk/Source/WebKit/chromium/src/AutofillPopupMenuClient.h
r91003 r91004 29 29 */ 30 30 31 #ifndef Auto FillPopupMenuClient_h32 #define Auto FillPopupMenuClient_h31 #ifndef AutofillPopupMenuClient_h 32 #define AutofillPopupMenuClient_h 33 33 34 34 #include "PopupMenuClient.h" … … 46 46 template <typename T> class WebVector; 47 47 48 // The Auto Fill suggestions popup menu client, used to display name suggestions48 // The Autofill suggestions popup menu client, used to display name suggestions 49 49 // with right-justified labels. 50 class Auto FillPopupMenuClient : public WebCore::PopupMenuClient {50 class AutofillPopupMenuClient : public WebCore::PopupMenuClient { 51 51 public: 52 Auto FillPopupMenuClient();53 virtual ~Auto FillPopupMenuClient();52 AutofillPopupMenuClient(); 53 virtual ~AutofillPopupMenuClient(); 54 54 55 55 // Returns the number of suggestions available. -
trunk/Source/WebKit/chromium/src/EditorClientImpl.cpp
r89991 r91004 44 44 45 45 #include "DOMUtilitiesPrivate.h" 46 #include "WebAuto FillClient.h"46 #include "WebAutofillClient.h" 47 47 #include "WebEditingAction.h" 48 48 #include "WebElement.h" … … 665 665 { 666 666 HTMLInputElement* inputElement = toHTMLInputElement(element); 667 if (m_webView->auto FillClient() && inputElement)668 m_webView->auto FillClient()->textFieldDidBeginEditing(WebInputElement(inputElement));667 if (m_webView->autofillClient() && inputElement) 668 m_webView->autofillClient()->textFieldDidBeginEditing(WebInputElement(inputElement)); 669 669 } 670 670 … … 672 672 { 673 673 HTMLInputElement* inputElement = toHTMLInputElement(element); 674 if (m_webView->auto FillClient() && inputElement)675 m_webView->auto FillClient()->textFieldDidEndEditing(WebInputElement(inputElement));674 if (m_webView->autofillClient() && inputElement) 675 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(inputElement)); 676 676 677 677 // Notification that focus was lost. Be careful with this, it's also sent … … 683 683 684 684 // Hide any showing popup. 685 m_webView->hideAuto FillPopup();685 m_webView->hideAutofillPopup(); 686 686 687 687 if (!m_webView->client()) … … 707 707 ASSERT(element->hasLocalName(HTMLNames::inputTag)); 708 708 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element); 709 if (m_webView->auto FillClient())710 m_webView->auto FillClient()->textFieldDidChange(WebInputElement(inputElement));709 if (m_webView->autofillClient()) 710 m_webView->autofillClient()->textFieldDidChange(WebInputElement(inputElement)); 711 711 712 712 // Note that we only show the autofill popup in this case if the caret is at … … 779 779 780 780 if ((!args->autofillOnEmptyValue && value.isEmpty()) || !isCaretAtEnd) { 781 m_webView->hideAuto FillPopup();781 m_webView->hideAutofillPopup(); 782 782 return; 783 783 } … … 811 811 { 812 812 HTMLInputElement* inputElement = toHTMLInputElement(element); 813 if (m_webView->auto FillClient() && inputElement) {814 m_webView->auto FillClient()->textFieldDidReceiveKeyDown(WebInputElement(inputElement),813 if (m_webView->autofillClient() && inputElement) { 814 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(inputElement), 815 815 WebKeyboardEventBuilder(*event)); 816 816 } -
trunk/Source/WebKit/chromium/src/WebInputElement.cpp
r89991 r91004 121 121 } 122 122 123 void WebInputElement::setAutofilled(bool auto Filled)123 void WebInputElement::setAutofilled(bool autofilled) 124 124 { 125 unwrap<HTMLInputElement>()->setAutofilled(auto Filled);125 unwrap<HTMLInputElement>()->setAutofilled(autofilled); 126 126 } 127 127 -
trunk/Source/WebKit/chromium/src/WebViewImpl.cpp
r90850 r91004 32 32 #include "WebViewImpl.h" 33 33 34 #include "Auto FillPopupMenuClient.h"34 #include "AutofillPopupMenuClient.h" 35 35 #include "AXObjectCache.h" 36 36 #include "BackForwardListChromium.h" … … 100 100 #include "Vector.h" 101 101 #include "WebAccessibilityObject.h" 102 #include "WebAuto FillClient.h"102 #include "WebAutofillClient.h" 103 103 #include "WebDevToolsAgentImpl.h" 104 104 #include "WebDevToolsAgentPrivate.h" … … 206 206 COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); 207 207 208 static const PopupContainerSettings auto FillPopupSettings = {208 static const PopupContainerSettings autofillPopupSettings = { 209 209 false, // setTextOnIndexChange 210 210 false, // acceptOnAbandon … … 276 276 } 277 277 278 void WebViewImpl::setAuto FillClient(WebAutoFillClient* autoFillClient)279 { 280 m_auto FillClient = autoFillClient;278 void WebViewImpl::setAutofillClient(WebAutofillClient* autofillClient) 279 { 280 m_autofillClient = autofillClient; 281 281 } 282 282 … … 301 301 WebViewImpl::WebViewImpl(WebViewClient* client) 302 302 : m_client(client) 303 , m_auto FillClient(0)303 , m_autofillClient(0) 304 304 , m_permissionClient(0) 305 305 , m_spellCheckClient(0) … … 324 324 , m_operationsAllowed(WebDragOperationNone) 325 325 , m_dragOperation(WebDragOperationNone) 326 , m_auto FillPopupShowing(false)327 , m_auto FillPopup(0)326 , m_autofillPopupShowing(false) 327 , m_autofillPopup(0) 328 328 , m_isTransparent(false) 329 329 , m_tabsToLinks(false) … … 461 461 462 462 // If a text field that has focus is clicked again, we should display the 463 // Auto Fill popup.463 // Autofill popup. 464 464 RefPtr<Node> focusedNode = focusedWebCoreNode(); 465 465 if (focusedNode.get() && toHTMLInputElement(focusedNode.get())) { … … 479 479 480 480 if (clickedNode.get() && clickedNode == focusedWebCoreNode()) { 481 // Focus has not changed, show the Auto Fill popup.481 // Focus has not changed, show the Autofill popup. 482 482 static_cast<EditorClientImpl*>(m_page->editorClient())-> 483 483 showFormAutofillForNode(clickedNode.get()); … … 656 656 bool WebViewImpl::autocompleteHandleKeyEvent(const WebKeyboardEvent& event) 657 657 { 658 if (!m_auto FillPopupShowing658 if (!m_autofillPopupShowing 659 659 // Home and End should be left to the text field to process. 660 660 || event.windowsKeyCode == VKEY_HOME … … 664 664 // Pressing delete triggers the removal of the selected suggestion from the DB. 665 665 if (event.windowsKeyCode == VKEY_DELETE 666 && m_auto FillPopup->selectedIndex() != -1) {666 && m_autofillPopup->selectedIndex() != -1) { 667 667 Node* node = focusedWebCoreNode(); 668 668 if (!node || (node->nodeType() != Node::ELEMENT_NODE)) { … … 676 676 } 677 677 678 int selectedIndex = m_auto FillPopup->selectedIndex();679 680 if (!m_auto FillPopupClient->canRemoveSuggestionAtIndex(selectedIndex))678 int selectedIndex = m_autofillPopup->selectedIndex(); 679 680 if (!m_autofillPopupClient->canRemoveSuggestionAtIndex(selectedIndex)) 681 681 return false; 682 682 683 683 WebString name = WebInputElement(static_cast<HTMLInputElement*>(element)).nameForAutofill(); 684 WebString value = m_auto FillPopupClient->itemText(selectedIndex);685 m_auto FillClient->removeAutocompleteSuggestion(name, value);684 WebString value = m_autofillPopupClient->itemText(selectedIndex); 685 m_autofillClient->removeAutocompleteSuggestion(name, value); 686 686 // Update the entries in the currently showing popup to reflect the 687 687 // deletion. 688 m_auto FillPopupClient->removeSuggestionAtIndex(selectedIndex);689 refreshAuto FillPopup();688 m_autofillPopupClient->removeSuggestionAtIndex(selectedIndex); 689 refreshAutofillPopup(); 690 690 return false; 691 691 } 692 692 693 if (!m_auto FillPopup->isInterestedInEventForKey(event.windowsKeyCode))693 if (!m_autofillPopup->isInterestedInEventForKey(event.windowsKeyCode)) 694 694 return false; 695 695 696 if (m_auto FillPopup->handleKeyEvent(PlatformKeyboardEventBuilder(event))) {696 if (m_autofillPopup->handleKeyEvent(PlatformKeyboardEventBuilder(event))) { 697 697 // We need to ignore the next Char event after this otherwise pressing 698 698 // enter when selecting an item in the menu will go to the page. … … 927 927 } 928 928 929 void WebViewImpl::hideAuto FillPopup()930 { 931 if (m_auto FillPopupShowing) {932 m_auto FillPopup->hidePopup();933 m_auto FillPopupShowing = false;929 void WebViewImpl::hideAutofillPopup() 930 { 931 if (m_autofillPopupShowing) { 932 m_autofillPopup->hidePopup(); 933 m_autofillPopupShowing = false; 934 934 } 935 935 } … … 1339 1339 m_imeAcceptEvents = true; 1340 1340 } else { 1341 hideAuto FillPopup();1341 hideAutofillPopup(); 1342 1342 hideSelectPopup(); 1343 1343 … … 2076 2076 } 2077 2077 2078 void WebViewImpl::applyAuto FillSuggestions(2078 void WebViewImpl::applyAutofillSuggestions( 2079 2079 const WebNode& node, 2080 2080 const WebVector<WebString>& names, … … 2089 2089 2090 2090 if (names.isEmpty()) { 2091 hideAuto FillPopup();2091 hideAutofillPopup(); 2092 2092 return; 2093 2093 } 2094 2094 2095 2095 RefPtr<Node> focusedNode = focusedWebCoreNode(); 2096 // If the node for which we queried the Auto Fill suggestions is not the2096 // If the node for which we queried the Autofill suggestions is not the 2097 2097 // focused node, then we have nothing to do. FIXME: also check the 2098 2098 // caret is at the end and that the text has not changed. 2099 2099 if (!focusedNode || focusedNode != PassRefPtr<Node>(node)) { 2100 hideAuto FillPopup();2100 hideAutofillPopup(); 2101 2101 return; 2102 2102 } … … 2105 2105 static_cast<HTMLInputElement*>(focusedNode.get()); 2106 2106 2107 // The first time the Auto Fill popup is shown we'll create the client and2107 // The first time the Autofill popup is shown we'll create the client and 2108 2108 // the popup. 2109 if (!m_auto FillPopupClient)2110 m_auto FillPopupClient = adoptPtr(new AutoFillPopupMenuClient);2111 2112 m_auto FillPopupClient->initialize(2109 if (!m_autofillPopupClient) 2110 m_autofillPopupClient = adoptPtr(new AutofillPopupMenuClient); 2111 2112 m_autofillPopupClient->initialize( 2113 2113 inputElem, names, labels, icons, uniqueIDs, separatorIndex); 2114 2114 2115 if (!m_auto FillPopup.get()) {2116 m_auto FillPopup = PopupContainer::create(m_autoFillPopupClient.get(),2115 if (!m_autofillPopup.get()) { 2116 m_autofillPopup = PopupContainer::create(m_autofillPopupClient.get(), 2117 2117 PopupContainer::Suggestion, 2118 auto FillPopupSettings);2119 } 2120 2121 if (m_auto FillPopupShowing) {2122 refreshAuto FillPopup();2118 autofillPopupSettings); 2119 } 2120 2121 if (m_autofillPopupShowing) { 2122 refreshAutofillPopup(); 2123 2123 } else { 2124 m_auto FillPopup->showInRect(focusedNode->getRect(), focusedNode->ownerDocument()->view(), 0);2125 m_auto FillPopupShowing = true;2124 m_autofillPopup->showInRect(focusedNode->getRect(), focusedNode->ownerDocument()->view(), 0); 2125 m_autofillPopupShowing = true; 2126 2126 } 2127 2127 } … … 2130 2130 { 2131 2131 hideSelectPopup(); 2132 hideAuto FillPopup();2132 hideAutofillPopup(); 2133 2133 } 2134 2134 … … 2356 2356 #endif 2357 2357 2358 void WebViewImpl::refreshAuto FillPopup()2359 { 2360 ASSERT(m_auto FillPopupShowing);2358 void WebViewImpl::refreshAutofillPopup() 2359 { 2360 ASSERT(m_autofillPopupShowing); 2361 2361 2362 2362 // Hide the popup if it has become empty. 2363 if (!m_auto FillPopupClient->listSize()) {2364 hideAuto FillPopup();2365 return; 2366 } 2367 2368 IntRect oldBounds = m_auto FillPopup->frameRect();2369 m_auto FillPopup->refresh(focusedWebCoreNode()->getRect());2370 IntRect newBounds = m_auto FillPopup->frameRect();2363 if (!m_autofillPopupClient->listSize()) { 2364 hideAutofillPopup(); 2365 return; 2366 } 2367 2368 IntRect oldBounds = m_autofillPopup->frameRect(); 2369 m_autofillPopup->refresh(focusedWebCoreNode()->getRect()); 2370 IntRect newBounds = m_autofillPopup->frameRect(); 2371 2371 // Let's resize the backing window if necessary. 2372 2372 if (oldBounds != newBounds) { 2373 2373 WebPopupMenuImpl* popupMenu = 2374 static_cast<WebPopupMenuImpl*>(m_auto FillPopup->client());2374 static_cast<WebPopupMenuImpl*>(m_autofillPopup->client()); 2375 2375 if (popupMenu) 2376 2376 popupMenu->client()->setWindowRect(m_chromeClientImpl.windowToScreen(newBounds)); -
trunk/Source/WebKit/chromium/src/WebViewImpl.h
r90850 r91004 72 72 namespace WebKit { 73 73 class AutocompletePopupMenuClient; 74 class Auto FillPopupMenuClient;74 class AutofillPopupMenuClient; 75 75 class ContextMenuClientImpl; 76 76 class DeviceOrientationClientProxy; … … 122 122 // WebView methods: 123 123 virtual void initializeMainFrame(WebFrameClient*); 124 virtual void setAuto FillClient(WebAutoFillClient*);124 virtual void setAutofillClient(WebAutofillClient*); 125 125 virtual void setDevToolsAgentClient(WebDevToolsAgentClient*); 126 126 virtual void setPermissionClient(WebPermissionClient*); … … 187 187 virtual WebDevToolsAgent* devToolsAgent(); 188 188 virtual WebAccessibilityObject accessibilityObject(); 189 virtual void applyAuto FillSuggestions(189 virtual void applyAutofillSuggestions( 190 190 const WebNode&, 191 191 const WebVector<WebString>& names, … … 235 235 } 236 236 237 WebAuto FillClient* autoFillClient()238 { 239 return m_auto FillClient;237 WebAutofillClient* autofillClient() 238 { 239 return m_autofillClient; 240 240 } 241 241 … … 327 327 const WebPoint& dragImageOffset); 328 328 329 void auto FillPopupDidHide()330 { 331 m_auto FillPopupShowing = false;329 void autofillPopupDidHide() 330 { 331 m_autofillPopupShowing = false; 332 332 } 333 333 … … 345 345 void popupClosed(WebCore::PopupContainer* popupContainer); 346 346 347 void hideAuto FillPopup();347 void hideAutofillPopup(); 348 348 349 349 // Returns the input event we're currently processing. This is used in some … … 404 404 bool autocompleteHandleKeyEvent(const WebKeyboardEvent&); 405 405 406 // Repaints the Auto Fill popup. Should be called when the suggestions407 // have changed. Note that this should only be called when the Auto Fill406 // Repaints the Autofill popup. Should be called when the suggestions 407 // have changed. Note that this should only be called when the Autofill 408 408 // popup is showing. 409 void refreshAuto FillPopup();409 void refreshAutofillPopup(); 410 410 411 411 // Returns true if the view was scrolled. … … 436 436 437 437 WebViewClient* m_client; 438 WebAuto FillClient* m_autoFillClient;438 WebAutofillClient* m_autofillClient; 439 439 WebPermissionClient* m_permissionClient; 440 440 WebSpellCheckClient* m_spellCheckClient; … … 511 511 WebDragOperation m_dragOperation; 512 512 513 // Whether an Auto Fill popup is currently showing.514 bool m_auto FillPopupShowing;515 516 // The Auto Fill popup client.517 OwnPtr<Auto FillPopupMenuClient> m_autoFillPopupClient;518 519 // The Auto Fill popup.520 RefPtr<WebCore::PopupContainer> m_auto FillPopup;513 // Whether an Autofill popup is currently showing. 514 bool m_autofillPopupShowing; 515 516 // The Autofill popup client. 517 OwnPtr<AutofillPopupMenuClient> m_autofillPopupClient; 518 519 // The Autofill popup. 520 RefPtr<WebCore::PopupContainer> m_autofillPopup; 521 521 522 522 // The popup associated with a select element.
Note: See TracChangeset
for help on using the changeset viewer.