[Chromium] Add WebKit API for WebCore::TextFieldDecorator
authortkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 04:24:37 +0000 (04:24 +0000)
committertkent@chromium.org <tkent@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2012 04:24:37 +0000 (04:24 +0000)
commit17ed01d8b54a635db0df90517cf23f2123efb90c
tree3da5b9efa83417b79d27eaec68c71a933a5e6021
parente6b3428c0e9c3f4c905e5e4731b1f486d8c63b7b
[Chromium] Add WebKit API for WebCore::TextFieldDecorator
https://bugs.webkit.org/show_bug.cgi?id=82143

Reviewed by Dimitri Glazkov.

Expose WebCore::TextFieldDecorator as
WebKit::WebTextFieldDecoratorClient. This change add capability to add
decoration buttons to text field <input> elements.

* WebKit.gyp: Add new files.
* public/WebTextFieldDecoratorClient.h: Added.
* public/WebView.h:
(WebKit): Add addTextFieldDecoratorClient().
* src/ChromeClientImpl.cpp:
(WebKit::ChromeClientImpl::willAddTextFieldDecorationsTo):
Calls willAddDecorationTo() of TextFieldDecorator objects owned by WebViewImpl.
(WebKit::ChromeClientImpl::addTextFieldDecorationsTo):
Apply TextFieldDecorationElement::decorate() for the specified input element.
* src/ChromeClientImpl.h:
(ChromeClientImpl): Add new function declarations.
* src/TextFieldDecoratorImpl.cpp:
Added. This is a bridge of WebCore::TextFieldDecorator and
WebKit::WebTextFieldDecoratorClient. This owns CachedImage objects
specfied by WebTextFieldDecoratorClient.
(WebKit::TextFieldDecoratorImpl::TextFieldDecoratorImpl):
(WebKit::TextFieldDecoratorImpl::create):
(WebKit::TextFieldDecoratorImpl::~TextFieldDecoratorImpl):
(WebKit::TextFieldDecoratorImpl::willAddDecorationTo):
(WebKit::TextFieldDecoratorImpl::imageForNormalState):
(WebKit::TextFieldDecoratorImpl::imageForDisabledState):
(WebKit::TextFieldDecoratorImpl::imageForReadonlyState):
(WebKit::TextFieldDecoratorImpl::handleClick):
(WebKit::TextFieldDecoratorImpl::willDetach):
* src/TextFieldDecoratorImpl.h: Added.
(TextFieldDecoratorImpl):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::addTextFieldDecoratorClient):
Add implementation of WebView::addTextFieldDecoratorClient().
* src/WebViewImpl.h:
WebViewImpl owns a vector of TextFieldDecoratorImpl.
(WebViewImpl):
(WebKit::WebViewImpl::textFieldDecorators):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112984 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gyp
Source/WebKit/chromium/public/WebTextFieldDecoratorClient.h [new file with mode: 0644]
Source/WebKit/chromium/public/WebView.h
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/ChromeClientImpl.h
Source/WebKit/chromium/src/TextFieldDecoratorImpl.cpp [new file with mode: 0644]
Source/WebKit/chromium/src/TextFieldDecoratorImpl.h [new file with mode: 0644]
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h