Changeset 120209 in webkit


Ignore:
Timestamp:
Jun 13, 2012 8:05:42 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[WK2] Add implementation for dispatchIntent in WebFrameLoaderClient
https://bugs.webkit.org/show_bug.cgi?id=88340

Patch by Christophe Dumez <Christophe Dumez> on 2012-06-13
Reviewed by Kenneth Rohde Christiansen.

Source/WebKit2:

Add implementation for dispatchIntent() in WebFrameLoaderClient.

  • CMakeLists.txt:
  • GNUmakefile.list.am:
  • Shared/API/c/WKBase.h:
  • Shared/APIClientTraits.h:
  • Shared/APIObject.h:
  • Shared/IntentData.cpp: Added.

(WebKit):
(WebKit::IntentData::encode):
(WebKit::IntentData::decode):

  • Shared/IntentData.h: Added.

(CoreIPC):
(WebKit):
(IntentData):

  • Target.pri:
  • UIProcess/API/C/WKAPICast.h:

(WebKit):

  • UIProcess/API/C/WKPage.h:
  • UIProcess/API/gtk/WebKitLoaderClient.cpp:

(attachLoaderClientToView):

  • UIProcess/WebIntentData.cpp: Added.

(WebKit):
(WebKit::WebIntentData::WebIntentData):
(WebKit::WebIntentData::data):

  • UIProcess/WebIntentData.h: Added.

(WebKit):
(WebIntentData):
(WebKit::WebIntentData::create):
(WebKit::WebIntentData::~WebIntentData):
(WebKit::WebIntentData::action):
(WebKit::WebIntentData::payloadType):
(WebKit::WebIntentData::extras):
(WebKit::WebIntentData::suggestions):
(WebKit::WebIntentData::type):

  • UIProcess/WebLoaderClient.cpp:

(WebKit):
(WebKit::WebLoaderClient::didReceiveIntentForFrame):

  • UIProcess/WebLoaderClient.h:

(WebKit):
(WebLoaderClient):

  • UIProcess/WebPageProxy.cpp:

(WebKit):
(WebKit::WebPageProxy::didReceiveIntentForFrame):

  • UIProcess/WebPageProxy.h:

(WebKit):
(WebPageProxy):

  • UIProcess/WebPageProxy.messages.in:
  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchIntent):

Tools:

Update initialization of WKPageLoaderClient.

  • MiniBrowser/mac/BrowserWindowController.m:

(-[BrowserWindowController awakeFromNib]):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::initialize):

Location:
trunk
Files:
19 edited
4 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/CMakeLists.txt

    r120041 r120209  
    123123    Shared/ImmutableArray.cpp
    124124    Shared/ImmutableDictionary.cpp
     125    Shared/IntentData.cpp
    125126    Shared/MutableArray.cpp
    126127    Shared/MutableDictionary.cpp
     
    237238    UIProcess/WebIconDatabaseClient.cpp
    238239    UIProcess/WebInspectorProxy.cpp
     240    UIProcess/WebIntentData.cpp
    239241    UIProcess/WebKeyValueStorageManagerProxy.cpp
    240242    UIProcess/WebLayerTreeRenderer.cpp
  • trunk/Source/WebKit2/ChangeLog

    r120205 r120209  
     12012-06-13  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [WK2] Add implementation for dispatchIntent in WebFrameLoaderClient
     4        https://bugs.webkit.org/show_bug.cgi?id=88340
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Add implementation for dispatchIntent() in WebFrameLoaderClient.
     9
     10        * CMakeLists.txt:
     11        * GNUmakefile.list.am:
     12        * Shared/API/c/WKBase.h:
     13        * Shared/APIClientTraits.h:
     14        * Shared/APIObject.h:
     15        * Shared/IntentData.cpp: Added.
     16        (WebKit):
     17        (WebKit::IntentData::encode):
     18        (WebKit::IntentData::decode):
     19        * Shared/IntentData.h: Added.
     20        (CoreIPC):
     21        (WebKit):
     22        (IntentData):
     23        * Target.pri:
     24        * UIProcess/API/C/WKAPICast.h:
     25        (WebKit):
     26        * UIProcess/API/C/WKPage.h:
     27        * UIProcess/API/gtk/WebKitLoaderClient.cpp:
     28        (attachLoaderClientToView):
     29        * UIProcess/WebIntentData.cpp: Added.
     30        (WebKit):
     31        (WebKit::WebIntentData::WebIntentData):
     32        (WebKit::WebIntentData::data):
     33        * UIProcess/WebIntentData.h: Added.
     34        (WebKit):
     35        (WebIntentData):
     36        (WebKit::WebIntentData::create):
     37        (WebKit::WebIntentData::~WebIntentData):
     38        (WebKit::WebIntentData::action):
     39        (WebKit::WebIntentData::payloadType):
     40        (WebKit::WebIntentData::extras):
     41        (WebKit::WebIntentData::suggestions):
     42        (WebKit::WebIntentData::type):
     43        * UIProcess/WebLoaderClient.cpp:
     44        (WebKit):
     45        (WebKit::WebLoaderClient::didReceiveIntentForFrame):
     46        * UIProcess/WebLoaderClient.h:
     47        (WebKit):
     48        (WebLoaderClient):
     49        * UIProcess/WebPageProxy.cpp:
     50        (WebKit):
     51        (WebKit::WebPageProxy::didReceiveIntentForFrame):
     52        * UIProcess/WebPageProxy.h:
     53        (WebKit):
     54        (WebPageProxy):
     55        * UIProcess/WebPageProxy.messages.in:
     56        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     57        (WebKit::WebFrameLoaderClient::dispatchIntent):
     58
    1592012-06-13  Balazs Kelemen  <kbalazs@webkit.org>
    260
  • trunk/Source/WebKit2/GNUmakefile.list.am

    r119837 r120209  
    363363        Source/WebKit2/Shared/ImmutableDictionary.cpp \
    364364        Source/WebKit2/Shared/ImmutableDictionary.h \
     365        Source/WebKit2/Shared/IntentData.cpp \
     366        Source/WebKit2/Shared/IntentData.h \
    365367        Source/WebKit2/Shared/LayerTreeContext.h \
    366368        Source/WebKit2/Shared/MutableArray.cpp \
     
    802804        Source/WebKit2/UIProcess/WebInspectorProxy.cpp \
    803805        Source/WebKit2/UIProcess/WebInspectorProxy.h \
     806        Source/WebKit2/UIProcess/WebIntentData.cpp \
     807        Source/WebKit2/UIProcess/WebIntentData.h \
    804808        Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.cpp \
    805809        Source/WebKit2/UIProcess/WebKeyValueStorageManagerProxy.h \
  • trunk/Source/WebKit2/Shared/API/c/WKBase.h

    r115411 r120209  
    9999typedef const struct OpaqueWKIconDatabase* WKIconDatabaseRef;
    100100typedef const struct OpaqueWKInspector* WKInspectorRef;
     101typedef const struct OpaqueWKIntentData* WKIntentDataRef;
    101102typedef const struct OpaqueWKKeyValueStorageManager* WKKeyValueStorageManagerRef;
    102103typedef const struct OpaqueWKMediaCacheManager* WKMediaCacheManagerRef;
  • trunk/Source/WebKit2/Shared/APIClientTraits.h

    r117301 r120209  
    5454
    5555template<> struct APIClientTraits<WKPageLoaderClient> {
    56     static const size_t interfaceSizesByVersion[2];
     56    static const size_t interfaceSizesByVersion[3];
    5757};
    5858
  • trunk/Source/WebKit2/Shared/APIObject.h

    r116796 r120209  
    8989        TypeIconDatabase,
    9090        TypeInspector,
     91        TypeIntentData,
    9192        TypeKeyValueStorageManager,
    9293        TypeMediaCacheManager,
  • trunk/Source/WebKit2/Shared/IntentData.cpp

    r120207 r120209  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef APIClientTraits_h
    27 #define APIClientTraits_h
     26#include "config.h"
     27#include "IntentData.h"
    2828
    29 #include "WKBundlePage.h"
    30 #include "WKPage.h"
     29#if ENABLE(WEB_INTENTS)
     30
     31#include "APIObject.h"
     32#include "DataReference.h"
     33#include "WebCoreArgumentCoders.h"
     34
     35using namespace WebCore;
    3136
    3237namespace WebKit {
    3338
    34 template <typename ClientInterface> struct APIClientTraits {
    35     static const size_t interfaceSizesByVersion[1];
    36 };
    37 template <typename ClientInterface> const size_t APIClientTraits<ClientInterface>::interfaceSizesByVersion[] = { sizeof(ClientInterface) };
     39void IntentData::encode(CoreIPC::ArgumentEncoder* encoder) const
     40{
     41    encoder->encode(action);
     42    encoder->encode(type);
     43    encoder->encode(CoreIPC::DataReference(data));
     44    encoder->encode(extras);
     45    encoder->encode(suggestions);
     46}
    3847
    39 template<> struct APIClientTraits<WKBundlePageLoaderClient> {
    40     static const size_t interfaceSizesByVersion[3];
    41 };
     48bool IntentData::decode(CoreIPC::ArgumentDecoder* decoder, IntentData& intentData)
     49{
     50    if (!decoder->decode(intentData.action))
     51        return false;
     52    if (!decoder->decode(intentData.type))
     53        return false;
     54    CoreIPC::DataReference data;
     55    if (!decoder->decode(data))
     56        return false;
     57    intentData.data.append(data.data(), data.size());
     58    if (!decoder->decode(intentData.extras))
     59        return false;
     60    if (!decoder->decode(intentData.suggestions))
     61        return false;
    4262
    43 template<> struct APIClientTraits<WKBundlePageResourceLoadClient> {
    44     static const size_t interfaceSizesByVersion[2];
    45 };
    46 
    47 template<> struct APIClientTraits<WKBundlePageFullScreenClient> {
    48     static const size_t interfaceSizesByVersion[2];
    49 };
    50 
    51 template<> struct APIClientTraits<WKPageContextMenuClient> {
    52     static const size_t interfaceSizesByVersion[3];
    53 };
    54 
    55 template<> struct APIClientTraits<WKPageLoaderClient> {
    56     static const size_t interfaceSizesByVersion[2];
    57 };
    58 
    59 template<> struct APIClientTraits<WKPageUIClient> {
    60     static const size_t interfaceSizesByVersion[2];
    61 };
    62 
    63 template<> struct APIClientTraits<WKBundlePageFormClient> {
    64     static const size_t interfaceSizesByVersion[2];
    65 };
     63    return true;
     64}
    6665
    6766} // namespace WebKit
    6867
    69 #endif // APIClientTraits_h
     68#endif // ENABLE(WEB_INTENTS)
     69
  • trunk/Source/WebKit2/Shared/IntentData.h

    r120207 r120209  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef APIClientTraits_h
    27 #define APIClientTraits_h
     26#ifndef IntentData_h
     27#define IntentData_h
    2828
    29 #include "WKBundlePage.h"
    30 #include "WKPage.h"
     29#if ENABLE(WEB_INTENTS)
     30
     31#include "APIObject.h"
     32#include "GenericCallback.h"
     33#include <wtf/text/WTFString.h>
     34
     35namespace CoreIPC {
     36class ArgumentDecoder;
     37class ArgumentEncoder;
     38}
    3139
    3240namespace WebKit {
    3341
    34 template <typename ClientInterface> struct APIClientTraits {
    35     static const size_t interfaceSizesByVersion[1];
    36 };
    37 template <typename ClientInterface> const size_t APIClientTraits<ClientInterface>::interfaceSizesByVersion[] = { sizeof(ClientInterface) };
     42struct IntentData {
     43    void encode(CoreIPC::ArgumentEncoder*) const;
     44    static bool decode(CoreIPC::ArgumentDecoder*, IntentData&);
    3845
    39 template<> struct APIClientTraits<WKBundlePageLoaderClient> {
    40     static const size_t interfaceSizesByVersion[3];
    41 };
    42 
    43 template<> struct APIClientTraits<WKBundlePageResourceLoadClient> {
    44     static const size_t interfaceSizesByVersion[2];
    45 };
    46 
    47 template<> struct APIClientTraits<WKBundlePageFullScreenClient> {
    48     static const size_t interfaceSizesByVersion[2];
    49 };
    50 
    51 template<> struct APIClientTraits<WKPageContextMenuClient> {
    52     static const size_t interfaceSizesByVersion[3];
    53 };
    54 
    55 template<> struct APIClientTraits<WKPageLoaderClient> {
    56     static const size_t interfaceSizesByVersion[2];
    57 };
    58 
    59 template<> struct APIClientTraits<WKPageUIClient> {
    60     static const size_t interfaceSizesByVersion[2];
    61 };
    62 
    63 template<> struct APIClientTraits<WKBundlePageFormClient> {
    64     static const size_t interfaceSizesByVersion[2];
     46    String action;
     47    String type;
     48    Vector<uint8_t> data;
     49    HashMap<String, String> extras;
     50    Vector<WebCore::KURL> suggestions;
    6551};
    6652
    6753} // namespace WebKit
    6854
    69 #endif // APIClientTraits_h
     55#endif // ENABLE(WEB_INTENTS)
     56
     57#endif // IntentData_h
  • trunk/Source/WebKit2/Target.pri

    r120205 r120209  
    7777    Shared/ImmutableArray.h \
    7878    Shared/ImmutableDictionary.h \
     79    Shared/IntentData.h \
    7980    Shared/LayerTreeContext.h \
    8081    Shared/MutableArray.h \
     
    253254    UIProcess/WebIconDatabaseClient.h \
    254255    UIProcess/WebInspectorProxy.h \
     256    UIProcess/WebIntentData.h \
    255257    UIProcess/WebKeyValueStorageManagerProxy.h \
    256258    UIProcess/WebLayerTreeRenderer.h \
     
    441443    Shared/ImmutableArray.cpp \
    442444    Shared/ImmutableDictionary.cpp \
     445    Shared/IntentData.cpp \
    443446    Shared/MutableArray.cpp \
    444447    Shared/MutableDictionary.cpp \
     
    597600    UIProcess/WebIconDatabaseClient.cpp \
    598601    UIProcess/WebInspectorProxy.cpp \
     602    UIProcess/WebIntentData.cpp \
    599603    UIProcess/WebKeyValueStorageManagerProxy.cpp \
    600604    UIProcess/WebLayerTreeRenderer.cpp \
  • trunk/Source/WebKit2/UIProcess/API/C/WKAPICast.h

    r115411 r120209  
    7171class WebIconDatabase;
    7272class WebInspectorProxy;
     73class WebIntentData;
    7374class WebKeyValueStorageManagerProxy;
    7475class WebMediaCacheManagerProxy;
     
    108109WK_ADD_API_MAPPING(WKHitTestResultRef, WebHitTestResult)
    109110WK_ADD_API_MAPPING(WKIconDatabaseRef, WebIconDatabase)
     111WK_ADD_API_MAPPING(WKIntentDataRef, WebIntentData)
    110112WK_ADD_API_MAPPING(WKKeyValueStorageManagerRef, WebKeyValueStorageManagerProxy)
    111113WK_ADD_API_MAPPING(WKMediaCacheManagerRef, WebMediaCacheManagerProxy)
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.h

    r116993 r120209  
    7474typedef void (*WKPageWillGoToBackForwardListItemCallback)(WKPageRef page, WKBackForwardListItemRef item, WKTypeRef userData, const void *clientInfo);
    7575typedef void (*WKPagePluginDidFailCallback)(WKPageRef page, WKErrorCode errorCode, WKStringRef mimeType, WKStringRef pluginIdentifier, WKStringRef pluginVersion, const void* clientInfo);
     76typedef void (*WKPageDidReceiveIntentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKIntentDataRef intent, const void *clientInfo);
    7677
    7778// Deprecated
     
    121122    WKPageCallback                                                      interactionOccurredWhileProcessUnresponsive;
    122123    WKPagePluginDidFailCallback                                         pluginDidFail;
     124
     125    // Version 2
     126    WKPageDidReceiveIntentForFrameCallback                              didReceiveIntentForFrame;
    123127};
    124128typedef struct WKPageLoaderClient WKPageLoaderClient;
    125129
    126 enum { kWKPageLoaderClientCurrentVersion = 1 };
     130enum { kWKPageLoaderClientCurrentVersion = 2 };
    127131
    128132// Policy Client.
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitLoaderClient.cpp

    r118795 r120209  
    150150        0, // interactionOccurredWhileProcessUnresponsive
    151151        0, // pluginDidFail
     152        0, // didReceiveIntentForFrame
    152153    };
    153154    WKPageRef wkPage = toAPI(webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)));
  • trunk/Source/WebKit2/UIProcess/WebIntentData.cpp

    r120207 r120209  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef APIClientTraits_h
    27 #define APIClientTraits_h
     26#include "config.h"
     27#include "WebIntentData.h"
    2828
    29 #include "WKBundlePage.h"
    30 #include "WKPage.h"
     29#if ENABLE(WEB_INTENTS)
    3130
    3231namespace WebKit {
    3332
    34 template <typename ClientInterface> struct APIClientTraits {
    35     static const size_t interfaceSizesByVersion[1];
    36 };
    37 template <typename ClientInterface> const size_t APIClientTraits<ClientInterface>::interfaceSizesByVersion[] = { sizeof(ClientInterface) };
     33WebIntentData::WebIntentData(const IntentData& store)
     34    : m_store(store)
     35{
     36}
    3837
    39 template<> struct APIClientTraits<WKBundlePageLoaderClient> {
    40     static const size_t interfaceSizesByVersion[3];
    41 };
    42 
    43 template<> struct APIClientTraits<WKBundlePageResourceLoadClient> {
    44     static const size_t interfaceSizesByVersion[2];
    45 };
    46 
    47 template<> struct APIClientTraits<WKBundlePageFullScreenClient> {
    48     static const size_t interfaceSizesByVersion[2];
    49 };
    50 
    51 template<> struct APIClientTraits<WKPageContextMenuClient> {
    52     static const size_t interfaceSizesByVersion[3];
    53 };
    54 
    55 template<> struct APIClientTraits<WKPageLoaderClient> {
    56     static const size_t interfaceSizesByVersion[2];
    57 };
    58 
    59 template<> struct APIClientTraits<WKPageUIClient> {
    60     static const size_t interfaceSizesByVersion[2];
    61 };
    62 
    63 template<> struct APIClientTraits<WKBundlePageFormClient> {
    64     static const size_t interfaceSizesByVersion[2];
    65 };
     38PassRefPtr<WebSerializedScriptValue> WebIntentData::data() const
     39{
     40    Vector<uint8_t> dataCopy = m_store.data;
     41    return WebSerializedScriptValue::adopt(dataCopy);
     42}
    6643
    6744} // namespace WebKit
    6845
    69 #endif // APIClientTraits_h
     46#endif // ENABLE(WEB_INTENTS)
     47
  • trunk/Source/WebKit2/UIProcess/WebIntentData.h

    r120207 r120209  
    11/*
    2  * Copyright (C) 2011 Apple Inc. All rights reserved.
     2 * Copyright (C) 2012 Intel Corporation. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef APIClientTraits_h
    27 #define APIClientTraits_h
     26#ifndef WebIntentData_h
     27#define WebIntentData_h
    2828
    29 #include "WKBundlePage.h"
    30 #include "WKPage.h"
     29#if ENABLE(WEB_INTENTS)
     30
     31#include "APIObject.h"
     32#include "IntentData.h"
     33#include "WebSerializedScriptValue.h"
     34#include <wtf/PassRefPtr.h>
    3135
    3236namespace WebKit {
    3337
    34 template <typename ClientInterface> struct APIClientTraits {
    35     static const size_t interfaceSizesByVersion[1];
    36 };
    37 template <typename ClientInterface> const size_t APIClientTraits<ClientInterface>::interfaceSizesByVersion[] = { sizeof(ClientInterface) };
     38class WebIntentData : public APIObject {
     39public:
     40    static const Type APIType = TypeIntentData;
    3841
    39 template<> struct APIClientTraits<WKBundlePageLoaderClient> {
    40     static const size_t interfaceSizesByVersion[3];
    41 };
     42    static PassRefPtr<WebIntentData> create(const IntentData& store)
     43    {
     44        return adoptRef(new WebIntentData(store));
     45    }
    4246
    43 template<> struct APIClientTraits<WKBundlePageResourceLoadClient> {
    44     static const size_t interfaceSizesByVersion[2];
    45 };
     47    virtual ~WebIntentData() { }
    4648
    47 template<> struct APIClientTraits<WKBundlePageFullScreenClient> {
    48     static const size_t interfaceSizesByVersion[2];
    49 };
     49    const String& action() const { return m_store.action; }
     50    const String& payloadType() const { return m_store.type; }
     51    PassRefPtr<WebSerializedScriptValue> data() const;
     52    const HashMap<String, String>& extras() const { return m_store.extras; }
     53    const Vector<WebCore::KURL>& suggestions() const { return m_store.suggestions; }
    5054
    51 template<> struct APIClientTraits<WKPageContextMenuClient> {
    52     static const size_t interfaceSizesByVersion[3];
    53 };
     55private:
     56    WebIntentData(const IntentData&);
    5457
    55 template<> struct APIClientTraits<WKPageLoaderClient> {
    56     static const size_t interfaceSizesByVersion[2];
    57 };
     58    virtual Type type() const { return APIType; }
    5859
    59 template<> struct APIClientTraits<WKPageUIClient> {
    60     static const size_t interfaceSizesByVersion[2];
    61 };
    62 
    63 template<> struct APIClientTraits<WKBundlePageFormClient> {
    64     static const size_t interfaceSizesByVersion[2];
     60    IntentData m_store;
    6561};
    6662
    6763} // namespace WebKit
    6864
    69 #endif // APIClientTraits_h
     65#endif // ENABLE(WEB_INTENTS)
     66
     67#endif // WebIntentData_h
  • trunk/Source/WebKit2/UIProcess/WebLoaderClient.cpp

    r116993 r120209  
    2828
    2929#include "ImmutableArray.h"
     30#include "WKAPICast.h"
    3031#include "WebBackForwardListItem.h"
    31 #include "WKAPICast.h"
     32#include "WebIntentData.h"
    3233#include <string.h>
    3334
     
    163164    m_client.didDetectXSSForFrame(toAPI(page), toAPI(frame), toAPI(userData), m_client.clientInfo);
    164165}
     166
     167#if ENABLE(WEB_INTENTS)
     168void WebLoaderClient::didReceiveIntentForFrame(WebPageProxy* page, WebFrameProxy* frame, WebIntentData* intentData)
     169{
     170    if (!m_client.didReceiveIntentForFrame)
     171        return;
     172
     173    m_client.didReceiveIntentForFrame(toAPI(page), toAPI(frame), toAPI(intentData), m_client.clientInfo);
     174}
     175#endif
    165176
    166177bool WebLoaderClient::canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy* page, WebFrameProxy* frame, WebProtectionSpace* protectionSpace)
  • trunk/Source/WebKit2/UIProcess/WebLoaderClient.h

    r116993 r120209  
    4848class WebProtectionSpace;
    4949
     50#if ENABLE(WEB_INTENTS)
     51class WebIntentData;
     52#endif
     53
    5054class WebLoaderClient : public APIClient<WKPageLoaderClient, kWKPageLoaderClientCurrentVersion> {
    5155public:
     
    6569    void didRunInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
    6670    void didDetectXSSForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
     71#if ENABLE(WEB_INTENTS)
     72    void didReceiveIntentForFrame(WebPageProxy*, WebFrameProxy*, WebIntentData*);
     73#endif
    6774
    6875    // FIXME: didFirstVisuallyNonEmptyLayoutForFrame and didNewFirstVisuallyNonEmptyLayout should be merged.
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r120021 r120209  
    3434#include "EventDispatcherMessages.h"
    3535#include "FindIndicator.h"
     36#include "IntentData.h"
    3637#include "Logging.h"
    3738#include "MessageID.h"
     
    6263#include "WebFullScreenManagerProxy.h"
    6364#include "WebInspectorProxy.h"
     65#include "WebIntentData.h"
    6466#include "WebNotificationManagerProxy.h"
    6567#include "WebOpenPanelResultListenerProxy.h"
     
    21362138    m_loaderClient.didDetectXSSForFrame(this, frame, userData.get());
    21372139}
     2140
     2141#if ENABLE(WEB_INTENTS)
     2142void WebPageProxy::didReceiveIntentForFrame(uint64_t frameID, const IntentData& intentData)
     2143{
     2144    WebFrameProxy* frame = process()->webFrame(frameID);
     2145    MESSAGE_CHECK(frame);
     2146
     2147    RefPtr<WebIntentData> webIntentData = WebIntentData::create(intentData);
     2148    m_loaderClient.didReceiveIntentForFrame(this, frame, webIntentData.get());
     2149}
     2150#endif
    21382151
    21392152void WebPageProxy::frameDidBecomeFrameSet(uint64_t frameID, bool value)
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r120021 r120209  
    157157#endif
    158158
     159#if ENABLE(WEB_INTENTS)
     160struct IntentData;
     161#endif
     162
    159163typedef GenericCallback<WKStringRef, StringImpl*> StringCallback;
    160164typedef GenericCallback<WKSerializedScriptValueRef, WebSerializedScriptValue*> ScriptValueCallback;
     
    710714    void didChangeProgress(double);
    711715    void didFinishProgress();
     716
     717#if ENABLE(WEB_INTENTS)
     718    void didReceiveIntentForFrame(uint64_t frameID, const IntentData&);
     719#endif
    712720   
    713721    void decidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, const WebCore::ResourceRequest&, uint64_t listenerID, CoreIPC::ArgumentDecoder*, bool& receivedPolicyAction, uint64_t& policyAction, uint64_t& downloadID);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r119189 r120209  
    9090    UnableToImplementPolicy(uint64_t frameID, WebCore::ResourceError error, WebKit::InjectedBundleUserMessageEncoder userData)
    9191
     92    # Intent messages
     93#if ENABLE(WEB_INTENTS)
     94    DidReceiveIntentForFrame(uint64_t frameID, WebKit::IntentData intent)
     95#endif
     96
    9297    # Progress messages
    9398    DidChangeProgress(double value)
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r119413 r120209  
    3434#include "InjectedBundleNavigationAction.h"
    3535#include "InjectedBundleUserMessageCoders.h"
     36#include "IntentData.h"
    3637#include "PlatformCertificateInfo.h"
    3738#include "PluginView.h"
     
    15391540
    15401541#if ENABLE(WEB_INTENTS)
    1541 void WebFrameLoaderClient::dispatchIntent(PassRefPtr<IntentRequest>)
    1542 {
    1543     notImplemented();
     1542void WebFrameLoaderClient::dispatchIntent(PassRefPtr<IntentRequest> request)
     1543{
     1544    WebPage* webPage = m_frame->page();
     1545    if (!webPage)
     1546        return;
     1547
     1548    IntentData intentData;
     1549    Intent* coreIntent = request->intent();
     1550    ASSERT(coreIntent);
     1551    intentData.action = coreIntent->action();
     1552    intentData.type = coreIntent->type();
     1553    intentData.data = coreIntent->data()->data();
     1554    intentData.extras = coreIntent->extras();
     1555    intentData.suggestions = coreIntent->suggestions();
     1556
     1557    webPage->send(Messages::WebPageProxy::DidReceiveIntentForFrame(m_frame->frameID(), intentData));
    15441558}
    15451559#endif
  • trunk/Tools/ChangeLog

    r120207 r120209  
     12012-06-13  Christophe Dumez  <christophe.dumez@intel.com>
     2
     3        [WK2] Add implementation for dispatchIntent in WebFrameLoaderClient
     4        https://bugs.webkit.org/show_bug.cgi?id=88340
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Update initialization of WKPageLoaderClient.
     9
     10        * MiniBrowser/mac/BrowserWindowController.m:
     11        (-[BrowserWindowController awakeFromNib]):
     12        * WebKitTestRunner/TestController.cpp:
     13        (WTR::TestController::initialize):
     14
    1152012-06-13  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
    216
  • trunk/Tools/MiniBrowser/mac/BrowserWindowController.m

    r116716 r120209  
    613613        0, // interactionOccurredWhileProcessUnresponsive
    614614        0, // pluginDidFail
     615        0, // didReceiveIntentForFrame
    615616    };
    616617    WKPageSetPageLoaderClient(_webView.pageRef, &loadClient);
  • trunk/Tools/WebKitTestRunner/TestController.cpp

    r119018 r120209  
    410410        0, // interactionOccurredWhileProcessUnresponsive
    411411        0, // pluginDidFail
     412        0, // didReceiveIntentForFrame
    412413    };
    413414    WKPageSetPageLoaderClient(m_mainWebView->page(), &pageLoaderClient);
Note: See TracChangeset for help on using the changeset viewer.