Source/WebCore/ChangeLog

 12011-11-23 Greg Billock <gbillock@google.com>
 2
 3 [Web Intents] Flagged-off implementation of an intent tag for registration.
 4 https://bugs.webkit.org/show_bug.cgi?id=73039
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 No new tests. (OOPS!)
 9
 10 * WebCore.gypi:
 11 * html/HTMLAttributeNames.in:
 12 * html/HTMLElementsAllInOne.cpp:
 13 * html/HTMLIntentElement.cpp: Added.
 14 (WebCore::HTMLIntentElement::HTMLIntentElement):
 15 (WebCore::HTMLIntentElement::create):
 16 (WebCore::HTMLIntentElement::insertedIntoDocument):
 17 * html/HTMLIntentElement.h: Added.
 18 * html/HTMLIntentElement.idl: Added.
 19 * html/HTMLTagNames.in:
 20 * loader/FrameLoaderClient.h:
 21 (WebCore::FrameLoaderClient::registerIntentService):
 22 * page/DOMWindow.idl:
 23
1242011-11-22 Kenneth Russell <kbr@google.com>
225
326 [chromium] Support Core Animation plugins in compositor

Source/WebKit/chromium/ChangeLog

 12011-11-23 Greg Billock <gbillock@google.com>
 2
 3 [Web Intents] Flagged-off implementation of an intent tag for registration.
 4 https://bugs.webkit.org/show_bug.cgi?id=73039
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * WebKit.gyp:
 9 * features.gypi:
 10 * public/WebIntentServiceInfo.h:
 11 * src/FrameLoaderClientImpl.cpp:
 12 (WebKit::FrameLoaderClientImpl::registerIntentService):
 13 * src/FrameLoaderClientImpl.h:
 14 * src/WebIntentServiceInfo.cpp: Copied from Source/WebKit/chromium/public/WebIntentServiceInfo.h.
 15 (WebKit::WebIntentServiceInfo::WebIntentServiceInfo):
 16 (WebKit::WebIntentServiceInfo::url):
 17 (WebKit::WebIntentServiceInfo::setURL):
 18 (WebKit::WebIntentServiceInfo::title):
 19 (WebKit::WebIntentServiceInfo::setTitle):
 20 (WebKit::WebIntentServiceInfo::action):
 21 (WebKit::WebIntentServiceInfo::setAction):
 22 (WebKit::WebIntentServiceInfo::type):
 23 (WebKit::WebIntentServiceInfo::setType):
 24 (WebKit::WebIntentServiceInfo::disposition):
 25 (WebKit::WebIntentServiceInfo::setDisposition):
 26
1272011-11-22 Kenneth Russell <kbr@google.com>
228
329 [chromium] Support Core Animation plugins in compositor

Source/WebCore/WebCore.gypi

12921292 'html/HTMLIFrameElement.idl',
12931293 'html/HTMLImageElement.idl',
12941294 'html/HTMLInputElement.idl',
 1295 'html/HTMLIntentElement.idl',
12951296 'html/HTMLIsIndexElement.idl',
12961297 'html/HTMLKeygenElement.idl',
12971298 'html/HTMLLIElement.idl',

54995500 'html/HTMLImageLoader.cpp',
55005501 'html/HTMLImageLoader.h',
55015502 'html/HTMLInputElement.cpp',
 5503 'html/HTMLIntentElement.cpp',
 5504 'html/HTMLIntentElement.h',
55025505 'html/HTMLIsIndexElement.cpp',
55035506 'html/HTMLIsIndexElement.h',
55045507 'html/HTMLKeygenElement.cpp',

Source/WebCore/html/HTMLAttributeNames.in

@@dir
9292direction
9393dirname
9494disabled
 95disposition
9596download
9697draggable
9798webkitdropzone

Source/WebCore/html/HTMLElementsAllInOne.cpp

6363#include "HTMLIFrameElement.cpp"
6464#include "HTMLImageElement.cpp"
6565#include "HTMLInputElement.cpp"
 66#include "HTMLIntentElement.cpp"
6667#include "HTMLIsIndexElement.cpp"
6768#include "HTMLKeygenElement.cpp"
6869#include "HTMLLIElement.cpp"

Source/WebCore/html/HTMLIntentElement.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 */
 19
 20#include "config.h"
 21#include "HTMLIntentElement.h"
 22
 23#if ENABLE(WEB_INTENTS)
 24
 25#include "Chrome.h"
 26#include "Document.h"
 27#include "Frame.h"
 28#include "FrameLoaderClient.h"
 29#include "HTMLNames.h"
 30#include "Page.h"
 31#include "QualifiedName.h"
 32
 33namespace WebCore {
 34
 35using namespace HTMLNames;
 36
 37inline HTMLIntentElement::HTMLIntentElement(const QualifiedName& tagName, Document* document)
 38 : HTMLElement(tagName, document)
 39{
 40 ASSERT(hasTagName(intentTag));
 41}
 42
 43PassRefPtr<HTMLIntentElement> HTMLIntentElement::create(const QualifiedName& tagName, Document* document)
 44{
 45 return adoptRef(new HTMLIntentElement(tagName, document));
 46}
 47
 48void HTMLIntentElement::insertedIntoDocument()
 49{
 50 HTMLElement::insertedIntoDocument();
 51 document()->frame()->loader()->client()->registerIntentService(
 52 getAttribute(actionAttr), getAttribute(typeAttr), getAttribute(hrefAttr), getAttribute(titleAttr), getAttribute(dispositionAttr));
 53}
 54
 55}
 56
 57#endif // ENABLE(WEB_INTENTS)

Source/WebCore/html/HTMLIntentElement.h

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 *
 19 */
 20#ifndef HTMLIntentElement_h
 21#define HTMLIntentElement_h
 22
 23#if ENABLE(WEB_INTENTS)
 24
 25#include "HTMLElement.h"
 26
 27namespace WebCore {
 28
 29class Document;
 30class QualifiedName;
 31
 32class HTMLIntentElement : public HTMLElement {
 33public:
 34 static PassRefPtr<HTMLIntentElement> create(const QualifiedName&, Document*);
 35
 36private:
 37 HTMLIntentElement(const QualifiedName&, Document*);
 38
 39 virtual void insertedIntoDocument();
 40};
 41
 42} // namespace WebCore
 43
 44#endif
 45
 46#endif

Source/WebCore/html/HTMLIntentElement.idl

 1/*
 2 * Copyright (C) 2011 The Chromium Authors.
 3 *
 4 * This library is free software; you can redistribute it and/or
 5 * modify it under the terms of the GNU Library General Public
 6 * License as published by the Free Software Foundation; either
 7 * version 2 of the License, or (at your option) any later version.
 8 *
 9 * This library is distributed in the hope that it will be useful,
 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 12 * Library General Public License for more details.
 13 *
 14 * You should have received a copy of the GNU Library General Public License
 15 * along with this library; see the file COPYING.LIB. If not, write to
 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 17 * Boston, MA 02110-1301, USA.
 18 */
 19
 20module html {
 21
 22 interface [
 23 Conditional=WEB_INTENTS
 24 ] HTMLIntentElement : HTMLElement {
 25 attribute [Reflect, URL] DOMString action;
 26 attribute [Reflect] DOMString type;
 27 attribute [Reflect, URL] DOMString href;
 28 attribute [Reflect] DOMString title;
 29 attribute [Reflect] DOMString disposition;
 30 };
 31
 32}

Source/WebCore/html/HTMLTagNames.in

@@iframe interfaceName=HTMLIFrameElement
6565image mapToTagName=img
6666img interfaceName=HTMLImageElement, constructorNeedsFormElement
6767input constructorNeedsFormElement, constructorNeedsCreatedByParser
 68intent conditional=WEB_INTENTS
6869ins interfaceName=HTMLModElement
6970isindex interfaceName=HTMLIsIndexElement, constructorNeedsFormElement
7071kbd interfaceName=HTMLElement

Source/WebCore/loader/FrameLoaderClient.h

@@namespace WebCore {
319319 virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext() = 0;
320320
321321 virtual bool shouldPaintBrokenImage(const KURL&) const { return true; }
 322
 323#if ENABLE(WEB_INTENTS)
 324 virtual void registerIntentService(const String& action, const String& type, const String& href, const String& title, const String& disposition) { }
 325#endif
322326 };
323327
324328} // namespace WebCore

Source/WebCore/page/DOMWindow.idl

@@module window {
446446 attribute HTMLIFrameElementConstructor HTMLIFrameElement;
447447 attribute HTMLImageElementConstructor HTMLImageElement;
448448 attribute HTMLInputElementConstructor HTMLInputElement;
 449#if defined(ENABLE_WEB_INTENTS) && ENABLE_WEB_INTENTS
 450 attribute HTMLIntentElementConstructor HTMLIntentElement;
 451#endif
449452 attribute HTMLIsIndexElementConstructor HTMLIsIndexElement;
450453 attribute HTMLKeygenElementConstructor HTMLKeygenElement;
451454 attribute HTMLLIElementConstructor HTMLLIElement;

Source/WebKit/chromium/WebKit.gyp

561561 'src/WebInputEvent.cpp',
562562 'src/WebInputEventConversion.cpp',
563563 'src/WebInputEventConversion.h',
 564 'src/WebIntentServiceInfo.cpp',
564565 'src/WebKit.cpp',
565566 'src/WebLabelElement.cpp',
566567 'src/WebLayer.cpp',

Source/WebKit/chromium/features.gypi

157157 'ENABLE_REGISTER_PROTOCOL_HANDLER=1',
158158 ],
159159 }],
 160 ['enable_web_intents==1', {
 161 'feature_defines': [
 162 'ENABLE_WEB_INTENTS=1',
 163 ],
 164 }],
160165 ['OS=="mac"', {
161166 'feature_defines': [
162167 'ENABLE_RUBBER_BANDING=1',

Source/WebKit/chromium/public/WebIntentServiceInfo.h

3131#ifndef WebIntentServiceInfo_h
3232#define WebIntentServiceInfo_h
3333
34 namespace WebKit {
 34#include "WebCommon.h"
 35#include "WebString.h"
 36#include "WebURL.h"
3537
36 class WebString;
37 class WebURL;
 38namespace WebKit {
3839
3940// Holds data used to initialize a Web Intents service (handler).
4041// See spec at http://www.chromium.org/developers/design-documents/webintentsapi
4142class WebIntentServiceInfo {
4243public:
 44 WebIntentServiceInfo(const WebString& action, const WebString& type, const WebURL& href,
 45 const WebString& title, const WebString& disposition);
4346 ~WebIntentServiceInfo() { }
4447
4548 // The location of the handler page registered by the service.

@@public:
6467 // context (the default).
6568 WEBKIT_EXPORT WebString disposition() const;
6669 WEBKIT_EXPORT void setDisposition(const WebString&);
 70
 71private:
 72 WebString m_action;
 73 WebString m_type;
 74 WebURL m_href;
 75 WebString m_title;
 76 WebString m_disposition;
6777};
6878
6979} // namespace WebKit

Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp

4747#include "HTMLAppletElement.h"
4848#include "HTMLFormElement.h" // needed by FormState.h
4949#include "HTMLNames.h"
 50#include "KURL.h"
5051#include "MIMETypeRegistry.h"
5152#include "MouseEvent.h"
5253#include "Page.h"

6465#include "WebFormElement.h"
6566#include "WebFrameClient.h"
6667#include "WebFrameImpl.h"
 68#include "WebIntentServiceInfo.h"
6769#include "WebKit.h"
6870#include "WebKitPlatformSupport.h"
6971#include "WebMimeRegistry.h"

@@PassRefPtr<FrameNetworkingContext> FrameLoaderClientImpl::createNetworkingContex
16171619 return FrameNetworkingContextImpl::create(m_webFrame->frame());
16181620}
16191621
 1622void FrameLoaderClientImpl::registerIntentService(
 1623 const WTF::String& action,
 1624 const WTF::String& type,
 1625 const WTF::String& href,
 1626 const WTF::String& title,
 1627 const WTF::String& disposition) {
 1628 WebURL baseUrl = m_webFrame->document().url();
 1629 WebCore::KURL baseURL = baseUrl.operator WebCore::KURL();
 1630 WebCore::KURL serviceURL(baseURL, href); // need TextEncoding?
 1631 WebURL url = serviceURL;
 1632 if (m_webFrame->client()) {
 1633 WebIntentServiceInfo service(action, type, url, title, disposition);
 1634 m_webFrame->client()->registerIntentService(webFrame(), service);
 1635 }
 1636}
 1637
16201638} // namespace WebKit

Source/WebKit/chromium/src/FrameLoaderClientImpl.h

@@public:
208208
209209 virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
210210
 211 virtual void registerIntentService(
 212 const WTF::String& action,
 213 const WTF::String& type,
 214 const WTF::String& href,
 215 const WTF::String& title,
 216 const WTF::String& disposition);
 217
211218private:
212219 void makeDocumentView();
213220

Source/WebKit/chromium/src/WebIntentServiceInfo.cpp

 1/*
 2 * Copyright (C) 2011 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions are
 6 * met:
 7 *
 8 * * Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * * Redistributions in binary form must reproduce the above
 11 * copyright notice, this list of conditions and the following disclaimer
 12 * in the documentation and/or other materials provided with the
 13 * distribution.
 14 * * Neither the name of Google Inc. nor the names of its
 15 * contributors may be used to endorse or promote products derived from
 16 * this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 29 */
 30
 31#include "config.h"
 32#include "WebIntentServiceInfo.h"
 33
 34namespace WebKit {
 35
 36WebIntentServiceInfo::WebIntentServiceInfo(const WebString& action,
 37 const WebString& type,
 38 const WebURL& href,
 39 const WebString& title,
 40 const WebString& disposition)
 41 : m_action(action),
 42 m_type(type),
 43 m_href(href),
 44 m_title(title),
 45 m_disposition(disposition) { }
 46
 47WebURL WebIntentServiceInfo::url() const
 48{
 49 return m_href;
 50}
 51
 52void WebIntentServiceInfo::setURL(const WebURL& url)
 53{
 54 m_href = url;
 55}
 56
 57WebString WebIntentServiceInfo::title() const
 58{
 59 return m_title;
 60}
 61
 62void WebIntentServiceInfo::setTitle(const WebString& title)
 63{
 64 m_title = title;
 65}
 66
 67WebString WebIntentServiceInfo::action() const
 68{
 69 return m_action;
 70}
 71
 72void WebIntentServiceInfo::setAction(const WebString& action)
 73{
 74 m_action = action;
 75}
 76
 77WebString WebIntentServiceInfo::type() const
 78{
 79 return m_type;
 80}
 81
 82void WebIntentServiceInfo::setType(const WebString& type)
 83{
 84 m_type = type;
 85}
 86
 87WebString WebIntentServiceInfo::disposition() const
 88{
 89 return m_disposition;
 90}
 91
 92void WebIntentServiceInfo::setDisposition(const WebString& disposition)
 93{
 94 m_disposition = disposition;
 95}
 96
 97} // namespace WebKit