| Differences between
and this patch
- a/Source/WebCore/ChangeLog +49 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2011-11-23  Greg Billock  <gbillock@google.com>
2
3
        [Web Intents] Flagged-off WebCore implementation of navigator.startActivity
4
        See http://www.chromium.org/developers/design-documents/webintentsapi
5
        for draft spec.
6
7
        https://bugs.webkit.org/show_bug.cgi?id=73051
8
9
        Reviewed by NOBODY (OOPS!).
10
11
        No new tests. (OOPS!)
12
13
        * WebCore.gypi:
14
        * bindings/v8/custom/V8IntentCustom.cpp: Added.
15
        (WebCore::V8Intent::constructorCallback):
16
        (WebCore::V8Intent::dataAccessorGetter):
17
        * loader/FrameLoaderClient.h:
18
        (WebCore::FrameLoaderClient::dispatchIntent):
19
        * page/DOMWindow.idl:
20
        * page/Intent.cpp: Added.
21
        (WebCore::Intent::Intent):
22
        (WebCore::Intent::action):
23
        (WebCore::Intent::setAction):
24
        (WebCore::Intent::type):
25
        (WebCore::Intent::setType):
26
        (WebCore::Intent::data):
27
        (WebCore::Intent::setData):
28
        * page/Intent.h: Added.
29
        (WebCore::Intent::create):
30
        * page/Intent.idl: Added.
31
        * page/IntentResultCallback.h: Added.
32
        (WebCore::IntentResultCallback::~IntentResultCallback):
33
        * page/IntentResultCallback.idl: Added.
34
        * page/IntentsController.cpp: Added.
35
        (WebCore::IntentsController::IntentsController):
36
        (WebCore::IntentsController::~IntentsController):
37
        (WebCore::IntentsController::getIntentId):
38
        (WebCore::IntentsController::postResult):
39
        (WebCore::IntentsController::postFailure):
40
        * page/IntentsController.h: Added.
41
        * page/Navigator.cpp:
42
        (WebCore::Navigator::startActivity):
43
        * page/Navigator.h:
44
        * page/Navigator.idl:
45
        * page/Page.cpp:
46
        (WebCore::Page::Page):
47
        * page/Page.h:
48
        (WebCore::Page::intentsController):
49
1
2011-11-28  Timothy Hatcher  <timothy@apple.com>
50
2011-11-28  Timothy Hatcher  <timothy@apple.com>
2
51
3
        Add support for knowing when a TreeElement is added or changed anywhere in a TreeOutline.
52
        Add support for knowing when a TreeElement is added or changed anywhere in a TreeOutline.
- a/Source/WebKit/chromium/ChangeLog -4 / +26 lines
Lines 1-3 a/Source/WebKit/chromium/ChangeLog_sec1
1
2011-11-23  Greg Billock  <gbillock@google.com>
2
3
        [Web Intents] Flagged-off WebCore implementation of navigator.startActivity
4
        https://bugs.webkit.org/show_bug.cgi?id=73051
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        * WebKit.gyp:
9
        * features.gypi:
10
        * public/WebIntent.h:
11
        * src/FrameLoaderClientImpl.cpp:
12
        (WebKit::FrameLoaderClientImpl::dispatchIntent):
13
        * src/FrameLoaderClientImpl.h:
14
        * src/WebFrameImpl.cpp:
15
        (WebKit::WebFrameImpl::handleIntentResult):
16
        (WebKit::WebFrameImpl::handleIntentFailure):
17
        * src/WebIntent.cpp: Copied from Source/WebKit/chromium/public/WebIntent.h.
18
        (WebKit::WebIntent::WebIntent):
19
1
2011-11-28  Jon Lee  <jonlee@apple.com>
20
2011-11-28  Jon Lee  <jonlee@apple.com>
2
21
3
        Possible fix for test failures in r101307.
22
        Possible fix for test failures in r101307.
Lines 898-907 a/Source/WebKit/chromium/ChangeLog_sec2
898
        Reviewed by Darin Fisher.
917
        Reviewed by Darin Fisher.
899
918
900
        * WebKit.gyp:
919
        * WebKit.gyp:
901
        * public/WebIntent.h: Added.
920
        * public/WebIntentsClient.h: Added.
902
        * public/WebIntentServiceInfo.h: Added.
921
        (WebKit::WebIntentsClient::~WebIntentsClient):
903
        * public/WebFrame.h:
922
        * public/WebIntentsController.h: Added.
904
        * public/WebFrameClient.h:
923
        * public/WebViewClient.h:
924
        (WebKit::WebViewClient::webIntentsClient):
925
        * src/WebIntentsController.cpp: Added.
926
        (WebKit::WebIntentsController::webIntentReply):
905
927
906
2011-11-22  Scott Graham  <scottmg@chromium.org>
928
2011-11-22  Scott Graham  <scottmg@chromium.org>
907
929
- a/Source/WebCore/Modules/intents/Intent.cpp +82 lines
Line 0 a/Source/WebCore/Modules/intents/Intent.cpp_sec1
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
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 * 3.  Neither the name of Google, Inc. ("Google") nor the names of
14
 *     its contributors may be used to endorse or promote products derived
15
 *     from this software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
28
29
#include "config.h"
30
#include "Intent.h"
31
32
#if ENABLE(WEB_INTENTS)
33
34
#include "SerializedScriptValue.h"
35
36
namespace WebCore {
37
38
39
Intent::Intent(const String& action, const String& type, PassRefPtr<SerializedScriptValue> data)
40
    : m_action(action)
41
    , m_type(type)
42
    , m_identifier(0)
43
{
44
    setData(data);
45
}
46
47
String Intent::action() const
48
{
49
    return m_action;
50
}
51
52
String Intent::type() const
53
{
54
    return m_type;
55
}
56
57
SerializedScriptValue* Intent::data() const
58
{
59
    return m_data.get();
60
}
61
62
void Intent::setData(PassRefPtr<SerializedScriptValue> data)
63
{
64
    if (data.get())
65
        m_data = SerializedScriptValue::createFromWire(data->toWireString());
66
    else
67
        m_data = SerializedScriptValue::nullValue();
68
}
69
70
int Intent::identifier() const
71
{
72
    return m_identifier;
73
}
74
75
void Intent::setIdentifier(int id)
76
{
77
    m_identifier = id;
78
}
79
80
} // namespace WebCore
81
82
#endif // ENABLE(WEB_INTENTS)
- a/Source/WebCore/Modules/intents/Intent.h +77 lines
Line 0 a/Source/WebCore/Modules/intents/Intent.h_sec1
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
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 * 3.  Neither the name of Google, Inc. ("Google") nor the names of
14
 *     its contributors may be used to endorse or promote products derived
15
 *     from this software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
28
29
#ifndef Intent_h
30
#define Intent_h
31
32
#if ENABLE(WEB_INTENTS)
33
34
#include <wtf/Forward.h>
35
#include <wtf/PassRefPtr.h>
36
#include <wtf/RefCounted.h>
37
#include <wtf/RefPtr.h>
38
#include <wtf/text/WTFString.h>
39
40
namespace WebCore {
41
42
class SerializedScriptValue;
43
44
class Intent : public RefCounted<Intent> {
45
public:
46
    static PassRefPtr<Intent> create(
47
        const String& action,
48
        const String& type,
49
        PassRefPtr<SerializedScriptValue> data)
50
    {
51
        return adoptRef(new Intent(action, type, data));
52
    }
53
54
    String action() const;
55
    String type() const;
56
    SerializedScriptValue* data() const;
57
58
    int identifier() const;
59
    void setIdentifier(int);
60
61
protected:
62
    Intent(const String& action, const String& type, PassRefPtr<SerializedScriptValue> data);
63
64
private:
65
    void setData(PassRefPtr<SerializedScriptValue>);
66
67
    String m_action;
68
    String m_type;
69
    RefPtr<SerializedScriptValue> m_data;
70
    int m_identifier;
71
};
72
73
} // namespace WebCore
74
75
#endif
76
77
#endif // Intent_h
- a/Source/WebCore/Modules/intents/Intent.idl +37 lines
Line 0 a/Source/WebCore/Modules/intents/Intent.idl_sec1
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
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
module window {
27
  interface [
28
      Conditional=WEB_INTENTS,
29
      CanBeConstructed,
30
      CustomConstructFunction,
31
      V8CustomConstructor,
32
  ] Intent {
33
        readonly attribute DOMString action;
34
        readonly attribute DOMString type;
35
        readonly attribute [CustomGetter] any data;
36
  };
37
}
- a/Source/WebCore/Modules/intents/IntentResultCallback.h +51 lines
Line 0 a/Source/WebCore/Modules/intents/IntentResultCallback.h_sec1
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
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 * 3.  Neither the name of Google, Inc. ("Google") nor the names of
14
 *     its contributors may be used to endorse or promote products derived
15
 *     from this software without specific prior written permission.
16
 *
17
 * THIS SOFTWARE IS PROVIDED BY GOOGLE AND ITS CONTRIBUTORS "AS IS" AND ANY
18
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
21
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
 */
28
29
#ifndef IntentResultCallback_h
30
#define IntentResultCallback_h
31
32
#include <wtf/RefCounted.h>
33
#include <wtf/RefPtr.h>
34
35
#if ENABLE(WEB_INTENTS)
36
37
namespace WebCore {
38
39
class SerializedScriptValue;
40
41
class IntentResultCallback : public RefCounted<IntentResultCallback> {
42
public:
43
    virtual ~IntentResultCallback() { }
44
    virtual bool handleEvent(RefPtr<SerializedScriptValue> result) = 0;
45
};
46
47
}
48
49
#endif
50
51
#endif // IntentResultCallback_h
- a/Source/WebCore/Modules/intents/IntentResultCallback.idl +34 lines
Line 0 a/Source/WebCore/Modules/intents/IntentResultCallback.idl_sec1
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
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
module window {
27
  interface [
28
      Conditional=WEB_INTENTS,
29
      LegacyDefaultOptionalArguments,
30
      Callback=FunctionOnly
31
  ] IntentResultCallback {
32
      boolean handleEvent(in SerializedScriptValue result);
33
  };
34
}
- a/Source/WebCore/Modules/intents/IntentsController.cpp +79 lines
Line 0 a/Source/WebCore/Modules/intents/IntentsController.cpp_sec1
1
/*
2
 * Copyright (C) 2010 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
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#include "config.h"
27
#include "IntentsController.h"
28
29
#if ENABLE(WEB_INTENTS)
30
31
#include "IntentResultCallback.h"
32
#include "SerializedScriptValue.h"
33
34
namespace WebCore {
35
36
IntentsController::IntentsController()
37
{
38
}
39
40
IntentsController::~IntentsController()
41
{
42
}
43
44
PassOwnPtr<IntentsController> IntentsController::create()
45
{
46
    return adoptPtr(new IntentsController);
47
}
48
49
int IntentsController::assignIntentId(PassRefPtr<IntentResultCallback> successCallback, PassRefPtr<IntentResultCallback> errorCallback)
50
{
51
    int id = m_successCallbacks.size();
52
    m_successCallbacks.append(successCallback);
53
    m_errorCallbacks.append(errorCallback);
54
    return id;
55
}
56
57
void IntentsController::postResult(const String& data, int intentId)
58
{
59
    RefPtr<SerializedScriptValue> value = SerializedScriptValue::createFromWire(data);
60
    if (m_successCallbacks[intentId].get())
61
        m_successCallbacks[intentId]->handleEvent(value);
62
63
    m_successCallbacks[intentId].clear();
64
    m_errorCallbacks[intentId].clear();
65
}
66
67
void IntentsController::postFailure(const String& data, int intentId)
68
{
69
    RefPtr<SerializedScriptValue> value = SerializedScriptValue::createFromWire(data);
70
    if (m_errorCallbacks[intentId].get())
71
        m_errorCallbacks[intentId]->handleEvent(value);
72
73
    m_successCallbacks[intentId].clear();
74
    m_errorCallbacks[intentId].clear();
75
}
76
77
} // namespace WebCore
78
79
#endif // ENABLE(WEB_INTENTS)
- a/Source/WebCore/Modules/intents/IntentsController.h +62 lines
Line 0 a/Source/WebCore/Modules/intents/IntentsController.h_sec1
1
/*
2
 * Copyright (C) 2010 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
6
 * are met:
7
 *
8
 * 1.  Redistributions of source code must retain the above copyright
9
 *     notice, this list of conditions and the following disclaimer.
10
 * 2.  Redistributions in binary form must reproduce the above copyright
11
 *     notice, this list of conditions and the following disclaimer in the
12
 *     documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
 * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
 */
25
26
#ifndef IntentsController_h
27
#define IntentsController_h
28
29
#if ENABLE(WEB_INTENTS)
30
31
#include <wtf/Forward.h>
32
#include <wtf/PassOwnPtr.h>
33
#include <wtf/PassRefPtr.h>
34
#include <wtf/Vector.h>
35
36
namespace WebCore {
37
38
class IntentResultCallback;
39
40
class IntentsController {
41
public:
42
    ~IntentsController();
43
44
    static PassOwnPtr<IntentsController> create();
45
46
    int assignIntentId(PassRefPtr<IntentResultCallback> successCallback, PassRefPtr<IntentResultCallback> errorCallback);
47
48
    void postResult(const String& data, int intentId);
49
    void postFailure(const String& data, int intentId);
50
51
private:
52
    IntentsController();
53
54
    Vector<RefPtr<IntentResultCallback> > m_successCallbacks;
55
    Vector<RefPtr<IntentResultCallback> > m_errorCallbacks;
56
};
57
58
} // namespace WebCore
59
60
#endif // ENABLE(WEB_INTENTS)
61
62
#endif // IntentsController_h
- a/Source/WebCore/WebCore.gyp/WebCore.gyp +1 lines
Lines 49-54 a/Source/WebCore/WebCore.gyp/WebCore.gyp_sec1
49
      '../',
49
      '../',
50
      '../..',
50
      '../..',
51
      '../Modules/gamepad',
51
      '../Modules/gamepad',
52
      '../Modules/intents',
52
      '../accessibility',
53
      '../accessibility',
53
      '../accessibility/chromium',
54
      '../accessibility/chromium',
54
      '../bindings',
55
      '../bindings',
- a/Source/WebCore/WebCore.gypi +8 lines
Lines 1139-1144 a/Source/WebCore/WebCore.gypi_sec1
1139
        'webcore_bindings_idl_files': [
1139
        'webcore_bindings_idl_files': [
1140
            'Modules/gamepad/Gamepad.idl',
1140
            'Modules/gamepad/Gamepad.idl',
1141
            'Modules/gamepad/GamepadList.idl',
1141
            'Modules/gamepad/GamepadList.idl',
1142
            'Modules/intents/Intent.idl',
1143
            'Modules/intents/IntentResultCallback.idl',
1142
            'css/CSSCharsetRule.idl',
1144
            'css/CSSCharsetRule.idl',
1143
            'css/CSSFontFaceRule.idl',
1145
            'css/CSSFontFaceRule.idl',
1144
            'css/CSSImportRule.idl',
1146
            'css/CSSImportRule.idl',
Lines 1680-1685 a/Source/WebCore/WebCore.gypi_sec2
1680
            'Modules/gamepad/Gamepad.h',
1682
            'Modules/gamepad/Gamepad.h',
1681
            'Modules/gamepad/GamepadList.cpp',
1683
            'Modules/gamepad/GamepadList.cpp',
1682
            'Modules/gamepad/GamepadList.h',
1684
            'Modules/gamepad/GamepadList.h',
1685
            'Modules/intents/Intent.cpp',
1686
            'Modules/intents/Intent.h',
1687
            'Modules/intents/IntentResultCallback.h',
1688
            'Modules/intents/IntentsController.cpp',
1689
            'Modules/intents/IntentsController.h',
1683
            'accessibility/AXObjectCache.cpp',
1690
            'accessibility/AXObjectCache.cpp',
1684
            'accessibility/AccessibilityARIAGrid.cpp',
1691
            'accessibility/AccessibilityARIAGrid.cpp',
1685
            'accessibility/AccessibilityARIAGrid.h',
1692
            'accessibility/AccessibilityARIAGrid.h',
Lines 2229-2234 a/Source/WebCore/WebCore.gypi_sec3
2229
            'bindings/v8/custom/V8Int16ArrayCustom.cpp',
2236
            'bindings/v8/custom/V8Int16ArrayCustom.cpp',
2230
            'bindings/v8/custom/V8Int32ArrayCustom.cpp',
2237
            'bindings/v8/custom/V8Int32ArrayCustom.cpp',
2231
            'bindings/v8/custom/V8Int8ArrayCustom.cpp',
2238
            'bindings/v8/custom/V8Int8ArrayCustom.cpp',
2239
            'bindings/v8/custom/V8IntentCustom.cpp',
2232
            'bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp',
2240
            'bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp',
2233
            'bindings/v8/custom/V8LocationCustom.cpp',
2241
            'bindings/v8/custom/V8LocationCustom.cpp',
2234
            'bindings/v8/custom/V8MessageChannelConstructor.cpp',
2242
            'bindings/v8/custom/V8MessageChannelConstructor.cpp',
- a/Source/WebCore/bindings/v8/custom/V8IntentCustom.cpp +107 lines
Line 0 a/Source/WebCore/bindings/v8/custom/V8IntentCustom.cpp_sec1
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
33
#if ENABLE(WEB_INTENTS)
34
35
#include "V8Intent.h"
36
37
#include "SerializedScriptValue.h"
38
#include "V8Binding.h"
39
#include "V8DOMWrapper.h"
40
#include "V8Proxy.h"
41
#include "WrapperTypeInfo.h"
42
43
namespace WebCore {
44
45
v8::Handle<v8::Value> V8Intent::constructorCallback(const v8::Arguments& args)
46
{
47
    INC_STATS("Intent.Constructor");
48
49
    if (!args.IsConstructCall())
50
        return throwError("DOM object constructor cannot be called as a function.");
51
52
    if (args.Length() == 0) {
53
        RefPtr<Intent> intent = Intent::create(String(), String(), SerializedScriptValue::nullValue());
54
        V8DOMWrapper::setDOMWrapper(args.Holder(), &info, intent.get());
55
        return toV8(intent.release(), args.Holder());
56
    }
57
58
    if (args.Length() == 2) {
59
        String action = toWebCoreStringWithNullOrUndefinedCheck(args[0]);
60
        String type = toWebCoreStringWithNullOrUndefinedCheck(args[1]);
61
62
        if (action.isEmpty())
63
            return throwError("Action cannot be empty");
64
        if (type.isEmpty())
65
            return throwError("Type cannot be empty");
66
67
        RefPtr<Intent> intent = Intent::create(action, type, SerializedScriptValue::nullValue());
68
        V8DOMWrapper::setDOMWrapper(args.Holder(), &info, intent.get());
69
        return toV8(intent.release(), args.Holder());
70
    }
71
72
    if (args.Length() == 3) {
73
        String action = toWebCoreStringWithNullOrUndefinedCheck(args[0]);
74
        String type = toWebCoreStringWithNullOrUndefinedCheck(args[1]);
75
76
        if (action.isEmpty())
77
            return throwError("Action cannot be empty");
78
        if (type.isEmpty())
79
            return throwError("Type cannot be empty");
80
81
        bool exception = false;
82
        RefPtr<SerializedScriptValue> data = SerializedScriptValue::create(args[2], 0, 0, exception);
83
        if (exception)
84
            return throwError("Intent constructor data must be a structured clone");
85
86
        RefPtr<Intent> intent = Intent::create(action, type, data);
87
        V8DOMWrapper::setDOMWrapper(args.Holder(), &info, intent.get());
88
        return toV8(intent.release(), args.Holder());
89
    }
90
91
    return throwError("Intent constructor must have zero or two or three parameters");
92
}
93
94
v8::Handle<v8::Value> V8Intent::dataAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
95
{
96
    Intent* impl = V8Intent::toNative(info.Holder());
97
98
    SerializedScriptValue* serializedValue = impl->data();
99
    if (serializedValue)
100
        return serializedValue->deserialize();
101
102
    return v8::Undefined();
103
}
104
105
} // namespace WebCore
106
107
#endif // ENABLE(WEB_INTENTS)
- a/Source/WebCore/loader/FrameLoaderClient.h +7 lines
Lines 78-83 namespace WebCore { a/Source/WebCore/loader/FrameLoaderClient.h_sec1
78
#endif
78
#endif
79
    class HTMLPlugInElement;
79
    class HTMLPlugInElement;
80
    class IntSize;
80
    class IntSize;
81
#if ENABLE(WEB_INTENTS)
82
    class Intent;
83
#endif
81
    class KURL;
84
    class KURL;
82
    class NavigationAction;
85
    class NavigationAction;
83
    class Page;
86
    class Page;
Lines 319-324 namespace WebCore { a/Source/WebCore/loader/FrameLoaderClient.h_sec2
319
        virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext() = 0;
322
        virtual PassRefPtr<FrameNetworkingContext> createNetworkingContext() = 0;
320
323
321
        virtual bool shouldPaintBrokenImage(const KURL&) const { return true; }
324
        virtual bool shouldPaintBrokenImage(const KURL&) const { return true; }
325
326
#if ENABLE(WEB_INTENTS)
327
        virtual void dispatchIntent(const Intent& intent) { }
328
#endif
322
    };
329
    };
323
330
324
} // namespace WebCore
331
} // namespace WebCore
- a/Source/WebCore/page/DOMWindow.idl +4 lines
Lines 618-623 module window { a/Source/WebCore/page/DOMWindow.idl_sec1
618
        attribute [EnabledAtRuntime=webkitVideoTrack] TrackEventConstructor TrackEvent;
618
        attribute [EnabledAtRuntime=webkitVideoTrack] TrackEventConstructor TrackEvent;
619
#endif
619
#endif
620
620
621
#if defined(ENABLE_WEB_INTENTS) && ENABLE_WEB_INTENTS
622
        attribute IntentConstructor Intent; // Usable with the new operator
623
#endif
624
621
        attribute DOMPluginConstructor Plugin;
625
        attribute DOMPluginConstructor Plugin;
622
        attribute DOMPluginArrayConstructor PluginArray;
626
        attribute DOMPluginArrayConstructor PluginArray;
623
627
- a/Source/WebCore/page/Navigator.cpp +27 lines
Lines 33-38 a/Source/WebCore/page/Navigator.cpp_sec1
33
#include "FrameLoader.h"
33
#include "FrameLoader.h"
34
#include "FrameLoaderClient.h"
34
#include "FrameLoaderClient.h"
35
#include "Geolocation.h"
35
#include "Geolocation.h"
36
#include "Intent.h"
37
#include "IntentResultCallback.h"
38
#include "IntentsController.h"
36
#include "PointerLock.h"
39
#include "PointerLock.h"
37
#include "KURL.h"
40
#include "KURL.h"
38
#include "Language.h"
41
#include "Language.h"
Lines 319-322 GamepadList* Navigator::webkitGamepads() a/Source/WebCore/page/Navigator.cpp_sec2
319
}
322
}
320
#endif
323
#endif
321
324
325
#if ENABLE(WEB_INTENTS)
326
void Navigator::startActivity(PassRefPtr<Intent> intent, PassRefPtr<IntentResultCallback> successCallback, PassRefPtr<IntentResultCallback> errorCallback, ExceptionCode& ec)
327
{
328
    if (!frame() || !frame()->loader() || !frame()->loader()->client() || !intent.get()) {
329
        ec = INVALID_STATE_ERR;
330
        return;
331
    }
332
333
    if (intent->action().isEmpty() || intent->type().isEmpty()) {
334
        ec = VALIDATION_ERR;
335
        return;
336
    }
337
338
    if (!ScriptController::processingUserGesture()) {
339
        ec = INVALID_ACCESS_ERR;
340
        return;
341
    }
342
343
    int id = m_frame->page()->intentsController()->assignIntentId(successCallback, errorCallback);
344
    intent->setIdentifier(id);
345
    m_frame->loader()->client()->dispatchIntent(*intent);
346
}
347
#endif
348
322
} // namespace WebCore
349
} // namespace WebCore
- a/Source/WebCore/page/Navigator.h +6 lines
Lines 33-38 class DOMPluginArray; a/Source/WebCore/page/Navigator.h_sec1
33
class Frame;
33
class Frame;
34
class GamepadList;
34
class GamepadList;
35
class Geolocation;
35
class Geolocation;
36
class Intent;
37
class IntentResultCallback;
36
class PointerLock;
38
class PointerLock;
37
class NavigatorUserMediaErrorCallback;
39
class NavigatorUserMediaErrorCallback;
38
class NavigatorUserMediaSuccessCallback;
40
class NavigatorUserMediaSuccessCallback;
Lines 79-84 public: a/Source/WebCore/page/Navigator.h_sec2
79
    GamepadList* webkitGamepads();
81
    GamepadList* webkitGamepads();
80
#endif
82
#endif
81
83
84
#if ENABLE(WEB_INTENTS)
85
    void startActivity(PassRefPtr<Intent>, PassRefPtr<IntentResultCallback> successCallback, PassRefPtr<IntentResultCallback> errorCallback, ExceptionCode&);
86
#endif
87
82
private:
88
private:
83
    Navigator(Frame*);
89
    Navigator(Frame*);
84
    Frame* m_frame;
90
    Frame* m_frame;
- a/Source/WebCore/page/Navigator.idl +5 lines
Lines 65-70 module window { a/Source/WebCore/page/Navigator.idl_sec1
65
#if defined(ENABLE_GAMEPAD) && ENABLE_GAMEPAD
65
#if defined(ENABLE_GAMEPAD) && ENABLE_GAMEPAD
66
        readonly attribute [EnabledAtRuntime] GamepadList webkitGamepads;
66
        readonly attribute [EnabledAtRuntime] GamepadList webkitGamepads;
67
#endif
67
#endif
68
69
#if defined(ENABLE_WEB_INTENTS) && ENABLE_WEB_INTENTS
70
        void startActivity(in Intent intent, in [Callback, Optional] IntentResultCallback successCallback, in [Callback, Optional] IntentResultCallback failureCallback)
71
            raises(DOMException);
72
#endif
68
    };
73
    };
69
74
70
}
75
}
- a/Source/WebCore/page/Page.cpp +4 lines
Lines 49-54 a/Source/WebCore/page/Page.cpp_sec1
49
#include "HistoryItem.h"
49
#include "HistoryItem.h"
50
#include "InspectorController.h"
50
#include "InspectorController.h"
51
#include "InspectorInstrumentation.h"
51
#include "InspectorInstrumentation.h"
52
#include "IntentsController.h"
52
#include "Logging.h"
53
#include "Logging.h"
53
#include "MediaCanStartListener.h"
54
#include "MediaCanStartListener.h"
54
#include "Navigator.h"
55
#include "Navigator.h"
Lines 148-153 Page::Page(PageClients& pageClients) a/Source/WebCore/page/Page.cpp_sec2
148
#if ENABLE(MEDIA_STREAM)
149
#if ENABLE(MEDIA_STREAM)
149
    , m_userMediaClient(pageClients.userMediaClient)
150
    , m_userMediaClient(pageClients.userMediaClient)
150
#endif
151
#endif
152
#if ENABLE(WEB_INTENTS)
153
    , m_intentsController(IntentsController::create())
154
#endif
151
    , m_settings(adoptPtr(new Settings(this)))
155
    , m_settings(adoptPtr(new Settings(this)))
152
    , m_progress(adoptPtr(new ProgressTracker))
156
    , m_progress(adoptPtr(new ProgressTracker))
153
    , m_backForwardController(adoptPtr(new BackForwardController(this, pageClients.backForwardClient)))
157
    , m_backForwardController(adoptPtr(new BackForwardController(this, pageClients.backForwardClient)))
- a/Source/WebCore/page/Page.h +7 lines
Lines 70-75 namespace WebCore { a/Source/WebCore/page/Page.h_sec1
70
    class HistoryItem;
70
    class HistoryItem;
71
    class InspectorClient;
71
    class InspectorClient;
72
    class InspectorController;
72
    class InspectorController;
73
    class IntentsController;
73
    class MediaCanStartListener;
74
    class MediaCanStartListener;
74
    class Node;
75
    class Node;
75
    class NotificationController;
76
    class NotificationController;
Lines 195-200 namespace WebCore { a/Source/WebCore/page/Page.h_sec2
195
#if ENABLE(MEDIA_STREAM)
196
#if ENABLE(MEDIA_STREAM)
196
        UserMediaClient* userMediaClient() const { return m_userMediaClient; }
197
        UserMediaClient* userMediaClient() const { return m_userMediaClient; }
197
#endif
198
#endif
199
#if ENABLE(WEB_INTENTS)
200
        IntentsController* intentsController() const { return m_intentsController.get(); }
201
#endif
198
        Settings* settings() const { return m_settings.get(); }
202
        Settings* settings() const { return m_settings.get(); }
199
        ProgressTracker* progress() const { return m_progress.get(); }
203
        ProgressTracker* progress() const { return m_progress.get(); }
200
        BackForwardController* backForward() const { return m_backForwardController.get(); }
204
        BackForwardController* backForward() const { return m_backForwardController.get(); }
Lines 381-386 namespace WebCore { a/Source/WebCore/page/Page.h_sec3
381
#if ENABLE(MEDIA_STREAM)
385
#if ENABLE(MEDIA_STREAM)
382
        UserMediaClient* m_userMediaClient;
386
        UserMediaClient* m_userMediaClient;
383
#endif
387
#endif
388
#if ENABLE(WEB_INTENTS)
389
        OwnPtr<IntentsController> m_intentsController;
390
#endif
384
        OwnPtr<Settings> m_settings;
391
        OwnPtr<Settings> m_settings;
385
        OwnPtr<ProgressTracker> m_progress;
392
        OwnPtr<ProgressTracker> m_progress;
386
        
393
        
- a/Source/WebKit/chromium/features.gypi +5 lines
Lines 154-159 a/Source/WebKit/chromium/features.gypi_sec1
154
          'ENABLE_REGISTER_PROTOCOL_HANDLER=1',
154
          'ENABLE_REGISTER_PROTOCOL_HANDLER=1',
155
        ],
155
        ],
156
      }],
156
      }],
157
      ['enable_web_intents==1', {
158
        'feature_defines': [
159
          'ENABLE_WEB_INTENTS=1',
160
        ],
161
      }],
157
      ['OS=="mac"', {
162
      ['OS=="mac"', {
158
        'feature_defines': [
163
        'feature_defines': [
159
          'ENABLE_RUBBER_BANDING=1',
164
          'ENABLE_RUBBER_BANDING=1',
- a/Source/WebKit/chromium/public/WebIntent.h +5 lines
Lines 34-39 a/Source/WebKit/chromium/public/WebIntent.h_sec1
34
#include "WebCommon.h"
34
#include "WebCommon.h"
35
#include "WebString.h"
35
#include "WebString.h"
36
36
37
#if WEBKIT_IMPLEMENTATION
38
namespace WebCore { class Intent; }
39
#endif
40
37
namespace WebKit {
41
namespace WebKit {
38
42
39
// Holds data passed through a Web Intents invocation call from the Javascript
43
// Holds data passed through a Web Intents invocation call from the Javascript
Lines 57-62 public: a/Source/WebKit/chromium/public/WebIntent.h_sec2
57
61
58
#if WEBKIT_IMPLEMENTATION
62
#if WEBKIT_IMPLEMENTATION
59
    WebIntent();
63
    WebIntent();
64
    WebIntent(const WebCore::Intent&);
60
#endif
65
#endif
61
66
62
private:
67
private:
- a/Source/WebKit/chromium/public/WebIntentServiceInfo.h +2 lines
Lines 68-73 public: a/Source/WebKit/chromium/public/WebIntentServiceInfo.h_sec1
68
68
69
#if WEBKIT_IMPLEMENTATION
69
#if WEBKIT_IMPLEMENTATION
70
    WebIntentServiceInfo();
70
    WebIntentServiceInfo();
71
    WebIntentServiceInfo(const WebString& action, const WebString& type, const WebURL& href,
72
                         const WebString& title, const WebString& disposition);
71
#endif
73
#endif
72
74
73
private:
75
private:
- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp +7 lines
Lines 64-69 a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp_sec1
64
#include "WebFormElement.h"
64
#include "WebFormElement.h"
65
#include "WebFrameClient.h"
65
#include "WebFrameClient.h"
66
#include "WebFrameImpl.h"
66
#include "WebFrameImpl.h"
67
#include "WebIntent.h"
67
#include "WebKit.h"
68
#include "WebKit.h"
68
#include "WebKitPlatformSupport.h"
69
#include "WebKitPlatformSupport.h"
69
#include "WebMimeRegistry.h"
70
#include "WebMimeRegistry.h"
Lines 1617-1620 PassRefPtr<FrameNetworkingContext> FrameLoaderClientImpl::createNetworkingContex a/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp_sec2
1617
    return FrameNetworkingContextImpl::create(m_webFrame->frame());
1618
    return FrameNetworkingContextImpl::create(m_webFrame->frame());
1618
}
1619
}
1619
1620
1621
void FrameLoaderClientImpl::dispatchIntent(const WebCore::Intent& intent)
1622
{
1623
    WebIntent webIntent(intent);
1624
    m_webFrame->client()->dispatchIntent(webFrame(), webIntent);
1625
}
1626
1620
} // namespace WebKit
1627
} // namespace WebKit
- a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h +2 lines
Lines 208-213 public: a/Source/WebKit/chromium/src/FrameLoaderClientImpl.h_sec1
208
208
209
    virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
209
    virtual PassRefPtr<WebCore::FrameNetworkingContext> createNetworkingContext();
210
210
211
    virtual void dispatchIntent(const WebCore::Intent&);
212
211
private:
213
private:
212
    void makeDocumentView();
214
    void makeDocumentView();
213
215
- a/Source/WebKit/chromium/src/WebFrameImpl.cpp +15 lines
Lines 104-109 a/Source/WebKit/chromium/src/WebFrameImpl.cpp_sec1
104
#include "HitTestResult.h"
104
#include "HitTestResult.h"
105
#include "IconURL.h"
105
#include "IconURL.h"
106
#include "InspectorController.h"
106
#include "InspectorController.h"
107
#include "IntentsController.h"
107
#include "KURL.h"
108
#include "KURL.h"
108
#include "Page.h"
109
#include "Page.h"
109
#include "PageOverlay.h"
110
#include "PageOverlay.h"
Lines 1828-1837 void WebFrameImpl::resetMatchCount() a/Source/WebKit/chromium/src/WebFrameImpl.cpp_sec2
1828
1829
1829
void WebFrameImpl::handleIntentResult(int intentIdentifier, const WebString& reply)
1830
void WebFrameImpl::handleIntentResult(int intentIdentifier, const WebString& reply)
1830
{
1831
{
1832
    if (!m_frame)
1833
        return;
1834
1835
#if ENABLE(WEB_INTENTS)
1836
    WTF::String replyString = reply.operator String();
1837
    m_frame->page()->intentsController()->postResult(replyString, intentIdentifier);
1838
#endif
1831
}
1839
}
1832
1840
1833
void WebFrameImpl::handleIntentFailure(int intentIdentifier, const WebString& reply)
1841
void WebFrameImpl::handleIntentFailure(int intentIdentifier, const WebString& reply)
1834
{
1842
{
1843
    if (!m_frame)
1844
        return;
1845
1846
#if ENABLE(WEB_INTENTS)
1847
    WTF::String replyString = reply.operator String();
1848
    m_frame->page()->intentsController()->postFailure(replyString, intentIdentifier);
1849
#endif
1835
}
1850
}
1836
1851
1837
WebString WebFrameImpl::contentAsText(size_t maxChars) const
1852
WebString WebFrameImpl::contentAsText(size_t maxChars) const
- a/Source/WebKit/chromium/src/WebIntent.cpp +9 lines
Lines 31-40 a/Source/WebKit/chromium/src/WebIntent.cpp_sec1
31
#include "config.h"
31
#include "config.h"
32
#include "WebIntent.h"
32
#include "WebIntent.h"
33
33
34
#include "Intent.h"
35
#include "SerializedScriptValue.h"
36
34
namespace WebKit {
37
namespace WebKit {
35
38
36
WebIntent::WebIntent() { }
39
WebIntent::WebIntent() { }
37
40
41
WebIntent::WebIntent(const WebCore::Intent& intent)
42
    : m_action(intent.action())
43
    , m_type(intent.type())
44
    , m_data(intent.data()->toWireString())
45
    , m_identifier(intent.identifier()) { }
46
38
WebString WebIntent::action() const
47
WebString WebIntent::action() const
39
{
48
{
40
    return m_action;
49
    return m_action;
- a/Source/WebKit/chromium/src/WebIntentServiceInfo.cpp +11 lines
Lines 35-40 namespace WebKit { a/Source/WebKit/chromium/src/WebIntentServiceInfo.cpp_sec1
35
35
36
WebIntentServiceInfo::WebIntentServiceInfo() { }
36
WebIntentServiceInfo::WebIntentServiceInfo() { }
37
37
38
WebIntentServiceInfo::WebIntentServiceInfo(const WebString& action,
39
                                           const WebString& type,
40
                                           const WebURL& href,
41
                                           const WebString& title,
42
                                           const WebString& disposition)
43
    : m_action(action)
44
    , m_type(type)
45
    , m_href(href)
46
    , m_title(title)
47
    , m_disposition(disposition) { }
48
38
WebURL WebIntentServiceInfo::url() const
49
WebURL WebIntentServiceInfo::url() const
39
{
50
{
40
    return m_href;
51
    return m_href;

Return to Bug 73051