| Differences between
and this patch
- Source/WebKit2/ChangeLog +36 lines
Lines 1-3 Source/WebKit2/ChangeLog_sec1
1
2013-07-30  Ruth Fong  <ruth_fong@apple.com>
2
3
        Rename <input type='color'> functions in WebPageProxy, WebColorPicker
4
        <rdar://problem/14549771> and https://bugs.webkit.org/show_bug.cgi?id=119097
5
6
        Reviewed by NOBODY (OOPS!).
7
8
        In bug 119025, WebColorChooserProxy was renamed WebColorPicker. This patch makes the UIProcess consistent
9
        by renaming UIProcess INPUT_TYPE_COLOR functions from ...colorChooser to ...colorPicker.
10
11
        * UIProcess/WebColorPicker.cpp:
12
        (WebKit::WebColorPicker::endPicker):
13
        * UIProcess/WebColorPicker.h:
14
        * UIProcess/WebColorPickerResultListenerProxy.cpp:
15
        (WebKit::WebColorPickerResultListenerProxy::setColor):
16
        * UIProcess/WebPageProxy.cpp:
17
        (WebKit::WebPageProxy::showColorPicker):
18
        (WebKit::WebPageProxy::setColorPickerColor):
19
        (WebKit::WebPageProxy::endColorPicker):
20
        (WebKit::WebPageProxy::didEndColorPicker):
21
        * UIProcess/WebPageProxy.h:
22
        * UIProcess/WebPageProxy.messages.in:
23
        * UIProcess/qt/WebColorPickerQt.cpp:
24
        (WebKit::WebColorPickerQt::createItem):
25
        (WebKit::WebColorPickerQt::notifyColorSelected):
26
        (WebKit::WebColorPickerQt::endPicker):
27
        * UIProcess/qt/WebColorPickerQt.h:
28
        * WebProcess/WebCoreSupport/WebColorChooser.cpp:
29
        (WebKit::WebColorChooser::WebColorChooser):
30
        (WebKit::WebColorChooser::setSelectedColor):
31
        (WebKit::WebColorChooser::endChooser):
32
        * WebProcess/WebPage/WebPage.cpp:
33
        (WebKit::WebPage::didEndColorPicker):
34
        * WebProcess/WebPage/WebPage.h:
35
        * WebProcess/WebPage/WebPage.messages.in:
36
1
2013-07-30  Anders Carlsson  <andersca@apple.com>
37
2013-07-30  Anders Carlsson  <andersca@apple.com>
2
38
3
        Speculative fix for crash due to string access on multiple threads
39
        Speculative fix for crash due to string access on multiple threads
- Source/WebKit2/UIProcess/WebColorPicker.cpp -2 / +2 lines
Lines 39-50 WebColorPicker::~WebColorPicker() Source/WebKit2/UIProcess/WebColorPicker.cpp_sec1
39
{
39
{
40
}
40
}
41
41
42
void WebColorPicker::endChooser()
42
void WebColorPicker::endPicker()
43
{
43
{
44
    if (!m_client)
44
    if (!m_client)
45
        return;
45
        return;
46
46
47
    m_client->didEndColorChooser();
47
    m_client->didEndColorPicker();
48
}
48
}
49
49
50
void WebColorPicker::setSelectedColor(const WebCore::Color& color)
50
void WebColorPicker::setSelectedColor(const WebCore::Color& color)
- Source/WebKit2/UIProcess/WebColorPicker.h -2 / +2 lines
Lines 47-53 public: Source/WebKit2/UIProcess/WebColorPicker.h_sec1
47
47
48
    public:
48
    public:
49
        virtual void didChooseColor(const WebCore::Color&) = 0;
49
        virtual void didChooseColor(const WebCore::Color&) = 0;
50
        virtual void didEndColorChooser() = 0;
50
        virtual void didEndColorPicker() = 0;
51
    };
51
    };
52
52
53
    static PassRefPtr<WebColorPicker> create(Client* client)
53
    static PassRefPtr<WebColorPicker> create(Client* client)
Lines 59-65 public: Source/WebKit2/UIProcess/WebColorPicker.h_sec2
59
59
60
    void invalidate() { m_client = 0; }
60
    void invalidate() { m_client = 0; }
61
61
62
    virtual void endChooser();
62
    virtual void endPicker();
63
    virtual void setSelectedColor(const WebCore::Color&);
63
    virtual void setSelectedColor(const WebCore::Color&);
64
64
65
protected:
65
protected:
- Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.cpp -2 / +2 lines
Lines 51-58 void WebColorPickerResultListenerProxy:: Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.cpp_sec1
51
    if (!m_page)
51
    if (!m_page)
52
        return;
52
        return;
53
53
54
    m_page->setColorChooserColor(WebCore::Color(color));
54
    m_page->setColorPickerColor(WebCore::Color(color));
55
    m_page->endColorChooser();
55
    m_page->endColorPicker();
56
}
56
}
57
57
58
} // namespace WebKit
58
} // namespace WebKit
- Source/WebKit2/UIProcess/WebPageProxy.cpp -7 / +7 lines
Lines 2926-2932 void WebPageProxy::needTouchEvents(bool Source/WebKit2/UIProcess/WebPageProxy.cpp_sec1
2926
#endif
2926
#endif
2927
2927
2928
#if ENABLE(INPUT_TYPE_COLOR)
2928
#if ENABLE(INPUT_TYPE_COLOR)
2929
void WebPageProxy::showColorChooser(const WebCore::Color& initialColor, const IntRect& elementRect)
2929
void WebPageProxy::showColorPicker(const WebCore::Color& initialColor, const IntRect& elementRect)
2930
{
2930
{
2931
    ASSERT(!m_colorPicker);
2931
    ASSERT(!m_colorPicker);
2932
2932
Lines 2943-2963 void WebPageProxy::showColorChooser(cons Source/WebKit2/UIProcess/WebPageProxy.cpp_sec2
2943
2943
2944
    m_colorPicker = m_pageClient->createColorPicker(this, initialColor, elementRect);
2944
    m_colorPicker = m_pageClient->createColorPicker(this, initialColor, elementRect);
2945
    if (!m_colorPicker)
2945
    if (!m_colorPicker)
2946
        didEndColorChooser();
2946
        didEndColorPicker();
2947
}
2947
}
2948
2948
2949
void WebPageProxy::setColorChooserColor(const WebCore::Color& color)
2949
void WebPageProxy::setColorPickerColor(const WebCore::Color& color)
2950
{
2950
{
2951
    ASSERT(m_colorPicker);
2951
    ASSERT(m_colorPicker);
2952
2952
2953
    m_colorPicker->setSelectedColor(color);
2953
    m_colorPicker->setSelectedColor(color);
2954
}
2954
}
2955
2955
2956
void WebPageProxy::endColorChooser()
2956
void WebPageProxy::endColorPicker()
2957
{
2957
{
2958
    ASSERT(m_colorPicker);
2958
    ASSERT(m_colorPicker);
2959
2959
2960
    m_colorPicker->endChooser();
2960
    m_colorPicker->endPicker();
2961
}
2961
}
2962
2962
2963
void WebPageProxy::didChooseColor(const WebCore::Color& color)
2963
void WebPageProxy::didChooseColor(const WebCore::Color& color)
Lines 2968-2974 void WebPageProxy::didChooseColor(const Source/WebKit2/UIProcess/WebPageProxy.cpp_sec3
2968
    m_process->send(Messages::WebPage::DidChooseColor(color), m_pageID);
2968
    m_process->send(Messages::WebPage::DidChooseColor(color), m_pageID);
2969
}
2969
}
2970
2970
2971
void WebPageProxy::didEndColorChooser()
2971
void WebPageProxy::didEndColorPicker()
2972
{
2972
{
2973
    if (!isValid())
2973
    if (!isValid())
2974
        return;
2974
        return;
Lines 2978-2984 void WebPageProxy::didEndColorChooser() Source/WebKit2/UIProcess/WebPageProxy.cpp_sec4
2978
        m_colorPicker = nullptr;
2978
        m_colorPicker = nullptr;
2979
    }
2979
    }
2980
2980
2981
    m_process->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
2981
    m_process->send(Messages::WebPage::DidEndColorPicker(), m_pageID);
2982
2982
2983
    m_colorPickerResultListener->invalidate();
2983
    m_colorPickerResultListener->invalidate();
2984
    m_colorPickerResultListener = nullptr;
2984
    m_colorPickerResultListener = nullptr;
- Source/WebKit2/UIProcess/WebPageProxy.h -4 / +4 lines
Lines 749-756 public: Source/WebKit2/UIProcess/WebPageProxy.h_sec1
749
    void postMessageToInjectedBundle(const String& messageName, APIObject* messageBody);
749
    void postMessageToInjectedBundle(const String& messageName, APIObject* messageBody);
750
750
751
#if ENABLE(INPUT_TYPE_COLOR)
751
#if ENABLE(INPUT_TYPE_COLOR)
752
    void setColorChooserColor(const WebCore::Color&);
752
    void setColorPickerColor(const WebCore::Color&);
753
    void endColorChooser();
753
    void endColorPicker();
754
#endif
754
#endif
755
755
756
    const WebLoaderClient& loaderClient() { return m_loaderClient; }
756
    const WebLoaderClient& loaderClient() { return m_loaderClient; }
Lines 900-908 private: Source/WebKit2/UIProcess/WebPageProxy.h_sec2
900
#endif
900
#endif
901
901
902
#if ENABLE(INPUT_TYPE_COLOR)
902
#if ENABLE(INPUT_TYPE_COLOR)
903
    void showColorChooser(const WebCore::Color& initialColor, const WebCore::IntRect&);
903
    void showColorPicker(const WebCore::Color& initialColor, const WebCore::IntRect&);
904
    void didChooseColor(const WebCore::Color&);
904
    void didChooseColor(const WebCore::Color&);
905
    void didEndColorChooser();
905
    void didEndColorPicker();
906
#endif
906
#endif
907
907
908
    void editorStateChanged(const EditorState&);
908
    void editorStateChanged(const EditorState&);
- Source/WebKit2/UIProcess/WebPageProxy.messages.in -3 / +3 lines
Lines 95-103 messages -> WebPageProxy { Source/WebKit2/UIProcess/WebPageProxy.messages.in_sec1
95
#endif
95
#endif
96
96
97
#if ENABLE(INPUT_TYPE_COLOR)
97
#if ENABLE(INPUT_TYPE_COLOR)
98
    ShowColorChooser(WebCore::Color initialColor, WebCore::IntRect elementRect);
98
    ShowColorPicker(WebCore::Color initialColor, WebCore::IntRect elementRect);
99
    SetColorChooserColor(WebCore::Color color);
99
    SetColorPickerColor(WebCore::Color color);
100
    EndColorChooser();
100
    EndColorPicker();
101
#endif
101
#endif
102
102
103
    # Policy messages
103
    # Policy messages
- Source/WebKit2/UIProcess/qt/WebColorPickerQt.cpp -4 / +4 lines
Lines 94-100 void WebColorPickerQt::createItem(QObjec Source/WebKit2/UIProcess/qt/WebColorPickerQt.cpp_sec1
94
94
95
    // Needs to be enqueue because it might trigger deletion.
95
    // Needs to be enqueue because it might trigger deletion.
96
    connect(contextObject, SIGNAL(accepted(QColor)), SLOT(notifyColorSelected(QColor)), Qt::QueuedConnection);
96
    connect(contextObject, SIGNAL(accepted(QColor)), SLOT(notifyColorSelected(QColor)), Qt::QueuedConnection);
97
    connect(contextObject, SIGNAL(rejected()), SLOT(endChooser()), Qt::QueuedConnection);
97
    connect(contextObject, SIGNAL(rejected()), SLOT(endPicker()), Qt::QueuedConnection);
98
98
99
    QQuickWebViewPrivate::get(m_webView)->addAttachedPropertyTo(m_colorChooser.get());
99
    QQuickWebViewPrivate::get(m_webView)->addAttachedPropertyTo(m_colorChooser.get());
100
    m_colorChooser->setParentItem(m_webView);
100
    m_colorChooser->setParentItem(m_webView);
Lines 132-141 void WebColorPickerQt::notifyColorSelect Source/WebKit2/UIProcess/qt/WebColorPickerQt.cpp_sec2
132
    Color coreColor = makeRGB(color.red(), color.green(), color.blue());
132
    Color coreColor = makeRGB(color.red(), color.green(), color.blue());
133
    m_client->didChooseColor(coreColor);
133
    m_client->didChooseColor(coreColor);
134
134
135
    endChooser();
135
    endPicker();
136
}
136
}
137
137
138
void WebColorPickerQt::endChooser()
138
void WebColorPickerQt::endPicker()
139
{
139
{
140
    m_colorChooser.clear();
140
    m_colorChooser.clear();
141
    m_context.clear();
141
    m_context.clear();
Lines 143-149 void WebColorPickerQt::endChooser() Source/WebKit2/UIProcess/qt/WebColorPickerQt.cpp_sec3
143
    if (!m_client)
143
    if (!m_client)
144
        return;
144
        return;
145
145
146
    m_client->didEndColorChooser();
146
    m_client->didEndColorPicker();
147
}
147
}
148
148
149
} // namespace WebKit
149
} // namespace WebKit
- Source/WebKit2/UIProcess/qt/WebColorPickerQt.h -1 / +1 lines
Lines 53-59 public: Source/WebKit2/UIProcess/qt/WebColorPickerQt.h_sec1
53
    virtual void setSelectedColor(const WebCore::Color&);
53
    virtual void setSelectedColor(const WebCore::Color&);
54
54
55
public Q_SLOTS:
55
public Q_SLOTS:
56
    virtual void endChooser();
56
    virtual void endPicker();
57
57
58
private Q_SLOTS:
58
private Q_SLOTS:
59
    void notifyColorSelected(const QColor&);
59
    void notifyColorSelected(const QColor&);
- Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp -3 / +3 lines
Lines 43-49 WebColorChooser::WebColorChooser(WebPage Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp_sec1
43
    , m_page(page)
43
    , m_page(page)
44
{
44
{
45
    m_page->setActiveColorChooser(this);
45
    m_page->setActiveColorChooser(this);
46
    WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::ShowColorChooser(initialColor, client->elementRectRelativeToRootView()), m_page->pageID());
46
    WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::ShowColorPicker(initialColor, client->elementRectRelativeToRootView()), m_page->pageID());
47
}
47
}
48
48
49
WebColorChooser::~WebColorChooser()
49
WebColorChooser::~WebColorChooser()
Lines 74-80 void WebColorChooser::setSelectedColor(c Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp_sec2
74
    if (!m_page)
74
    if (!m_page)
75
        return;
75
        return;
76
76
77
    WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::SetColorChooserColor(color), m_page->pageID());
77
    WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::SetColorPickerColor(color), m_page->pageID());
78
}
78
}
79
79
80
void WebColorChooser::endChooser()
80
void WebColorChooser::endChooser()
Lines 82-88 void WebColorChooser::endChooser() Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp_sec3
82
    if (!m_page)
82
    if (!m_page)
83
        return;
83
        return;
84
84
85
    WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::EndColorChooser(), m_page->pageID());
85
    WebProcess::shared().parentProcessConnection()->send(Messages::WebPageProxy::EndColorPicker(), m_page->pageID());
86
}
86
}
87
87
88
} // namespace WebKit
88
} // namespace WebKit
- Source/WebKit2/WebProcess/WebPage/WebPage.cpp -1 / +1 lines
Lines 2844-2850 void WebPage::setActiveColorChooser(WebC Source/WebKit2/WebProcess/WebPage/WebPage.cpp_sec1
2844
    m_activeColorChooser = colorChooser;
2844
    m_activeColorChooser = colorChooser;
2845
}
2845
}
2846
2846
2847
void WebPage::didEndColorChooser()
2847
void WebPage::didEndColorPicker()
2848
{
2848
{
2849
    m_activeColorChooser->didEndChooser();
2849
    m_activeColorChooser->didEndChooser();
2850
}
2850
}
- Source/WebKit2/WebProcess/WebPage/WebPage.h -1 / +1 lines
Lines 235-241 public: Source/WebKit2/WebProcess/WebPage/WebPage.h_sec1
235
    WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
235
    WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
236
    void setActiveColorChooser(WebColorChooser*);
236
    void setActiveColorChooser(WebColorChooser*);
237
    void didChooseColor(const WebCore::Color&);
237
    void didChooseColor(const WebCore::Color&);
238
    void didEndColorChooser();
238
    void didEndColorPicker();
239
#endif
239
#endif
240
240
241
    WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
241
    WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
- Source/WebKit2/WebProcess/WebPage/WebPage.messages.in -1 / +1 lines
Lines 48-54 messages -> WebPage LegacyReceiver { Source/WebKit2/WebProcess/WebPage/WebPage.messages.in_sec1
48
#endif
48
#endif
49
49
50
#if ENABLE(INPUT_TYPE_COLOR)
50
#if ENABLE(INPUT_TYPE_COLOR)
51
    DidEndColorChooser()
51
    DidEndColorPicker()
52
    DidChooseColor(WebCore::Color color)
52
    DidChooseColor(WebCore::Color color)
53
#endif
53
#endif
54
54

Return to Bug 119097