| Differences between
and this patch
- a/Source/WebCore/ChangeLog +11 lines
Lines 1-3 a/Source/WebCore/ChangeLog_sec1
1
2011-12-18  Keishi Hattori  <keishi@webkit.org>
2
3
        Implement <input type=color> UI WebKit chromium part
4
        https://bugs.webkit.org/show_bug.cgi?id=65897
5
6
        Reviewed by Darin Fisher.
7
8
        * GNUmakefile.list.am: Removed ColorChooser.cpp and added ColorChooserClient.h
9
        * WebCore.gypi: Added ColorChooser.h and ColorChooserClient.h
10
        * WebCore.xcodeproj/project.pbxproj: Removed ColorChooser.cpp and added ColorChooserClient.h
11
1
2011-12-18  Luke Macpherson   <macpherson@chromium.org>
12
2011-12-18  Luke Macpherson   <macpherson@chromium.org>
2
13
3
        Implement CSS line-height property in CSSStyleApplyProperty.
14
        Implement CSS line-height property in CSSStyleApplyProperty.
- a/Source/WebKit/chromium/ChangeLog +35 lines
Lines 1-3 a/Source/WebKit/chromium/ChangeLog_sec1
1
2011-12-18  Keishi Hattori  <keishi@webkit.org>
2
3
        Implement <input type=color> UI WebKit chromium part
4
        https://bugs.webkit.org/show_bug.cgi?id=65897
5
6
        Reviewed by Darin Fisher.
7
8
        * WebKit.gyp: Added new files.
9
        * features.gypi: Added ENABLE_INPUT_COLOR.
10
        * public/WebColorChooser.h: Added. Interface for ColorChooserProxy to call.
11
        (WebKit::WebColorChooser::~WebColorChooser):
12
        (WebKit::WebColorChooser::setSelectedColor):
13
        (WebKit::WebColorChooser::endChooser):
14
        * public/WebColorChooserClient.h: Added.
15
        (WebKit::WebColorChooserClient::~WebColorChooserClient):
16
        (WebKit::WebColorChooserClient::didChooseColor): Only called when user changes the color.
17
        (WebKit::WebColorChooserClient::didEndChooser): Called when WebColorChooser::endChooser is called.
18
        * public/WebViewClient.h:
19
        (WebKit::WebViewClient::createColorChooser): Creates a new color chooser. If there is an old color chooser, this will end it.
20
        * src/ChromeClientImpl.cpp:
21
        (WebKit::ChromeClientImpl::createColorChooser): Calls WebViewClient::createColorChooser.
22
        * src/ChromeClientImpl.h:
23
        * src/ColorChooserProxy.cpp: Proxies calls to WebCore::ColorChooser to WebKit::WebColorChooser.
24
        (WebKit::ColorChooserProxy::ColorChooserProxy):
25
        (WebKit::ColorChooserProxy::~ColorChooserProxy):
26
        (WebKit::ColorChooserProxy::setSelectedColor):
27
        (WebKit::ColorChooserProxy::endChooser):
28
        * src/ColorChooserProxy.h:
29
        * src/WebColorChooserClientImpl.cpp: Proxies calls to WebKit::WebColorChooserClient to WebCore::ColorChooserClient.
30
        (WebKit::WebColorChooserClientImpl::WebColorChooserClientImpl):
31
        (WebKit::WebColorChooserClientImpl::~WebColorChooserClientImpl):
32
        (WebKit::WebColorChooserClientImpl::didChooseColor):
33
        (WebKit::WebColorChooserClientImpl::didEndChooser):
34
        * src/WebColorChooserClientImpl.h: Added.
35
1
2011-12-18  James Kozianski  <koz@chromium.org>
36
2011-12-18  James Kozianski  <koz@chromium.org>
2
37
3
        [chromium] Add worldId parameter to allowScriptExtension()
38
        [chromium] Add worldId parameter to allowScriptExtension()
- a/Source/WebCore/GNUmakefile.list.am -1 / +1 lines
Lines 2475-2482 webcore_sources += \ a/Source/WebCore/GNUmakefile.list.am_sec1
2475
	Source/WebCore/platform/Clock.h \
2475
	Source/WebCore/platform/Clock.h \
2476
	Source/WebCore/platform/ClockGeneric.cpp \
2476
	Source/WebCore/platform/ClockGeneric.cpp \
2477
	Source/WebCore/platform/ClockGeneric.h \
2477
	Source/WebCore/platform/ClockGeneric.h \
2478
	Source/WebCore/platform/ColorChooser.cpp \
2479
	Source/WebCore/platform/ColorChooser.h \
2478
	Source/WebCore/platform/ColorChooser.h \
2479
	Source/WebCore/platform/ColorChooserClient.h \
2480
	Source/WebCore/platform/ContentType.cpp \
2480
	Source/WebCore/platform/ContentType.cpp \
2481
	Source/WebCore/platform/ContentType.h \
2481
	Source/WebCore/platform/ContentType.h \
2482
	Source/WebCore/platform/ContextMenu.h \
2482
	Source/WebCore/platform/ContextMenu.h \
- a/Source/WebCore/WebCore.gypi +2 lines
Lines 667-672 a/Source/WebCore/WebCore.gypi_sec1
667
            'page/mac/WebCoreFrameView.h',
667
            'page/mac/WebCoreFrameView.h',
668
            'platform/AsyncFileStream.h',
668
            'platform/AsyncFileStream.h',
669
            'platform/Clock.h',
669
            'platform/Clock.h',
670
            'platform/ColorChooser.h',
671
            'platform/ColorChooserClient.h',
670
            'platform/ContextMenu.h',
672
            'platform/ContextMenu.h',
671
            'platform/ContextMenuItem.h',
673
            'platform/ContextMenuItem.h',
672
            'platform/Cookie.h',
674
            'platform/Cookie.h',
- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj -4 / +4 lines
Lines 5437-5444 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec1
5437
		C0F2A44113869AAB0066C534 /* preprocessor.pm in Headers */ = {isa = PBXBuildFile; fileRef = C0F2A43F13869A280066C534 /* preprocessor.pm */; settings = {ATTRIBUTES = (Private, ); }; };
5437
		C0F2A44113869AAB0066C534 /* preprocessor.pm in Headers */ = {isa = PBXBuildFile; fileRef = C0F2A43F13869A280066C534 /* preprocessor.pm */; settings = {ATTRIBUTES = (Private, ); }; };
5438
		C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */; };
5438
		C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */; };
5439
		C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */; };
5439
		C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */; };
5440
		C330A22213EC196B0000B45B /* ColorChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C330A22013EC196B0000B45B /* ColorChooser.cpp */; };
5441
		C330A22313EC196B0000B45B /* ColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = C330A22113EC196B0000B45B /* ColorChooser.h */; settings = {ATTRIBUTES = (Private, ); }; };
5440
		C330A22313EC196B0000B45B /* ColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = C330A22113EC196B0000B45B /* ColorChooser.h */; settings = {ATTRIBUTES = (Private, ); }; };
5441
		C37CDEBD149EF2030042090D /* ColorChooserClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C37CDEBC149EF2030042090D /* ColorChooserClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
5442
		C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50B561412119D23008B46E0 /* GroupSettings.cpp */; };
5442
		C50B561612119D23008B46E0 /* GroupSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50B561412119D23008B46E0 /* GroupSettings.cpp */; };
5443
		C50B561712119D23008B46E0 /* GroupSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = C50B561512119D23008B46E0 /* GroupSettings.h */; settings = {ATTRIBUTES = (Private, ); }; };
5443
		C50B561712119D23008B46E0 /* GroupSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = C50B561512119D23008B46E0 /* GroupSettings.h */; settings = {ATTRIBUTES = (Private, ); }; };
5444
		C50D0E820FF4272900AC2644 /* StorageNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50D0E800FF4272900AC2644 /* StorageNamespace.cpp */; };
5444
		C50D0E820FF4272900AC2644 /* StorageNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C50D0E800FF4272900AC2644 /* StorageNamespace.cpp */; };
Lines 12811-12818 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec2
12811
		C0F2A43F13869A280066C534 /* preprocessor.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = preprocessor.pm; path = scripts/preprocessor.pm; sourceTree = "<group>"; };
12811
		C0F2A43F13869A280066C534 /* preprocessor.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = preprocessor.pm; path = scripts/preprocessor.pm; sourceTree = "<group>"; };
12812
		C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextEncodingDetectorICU.cpp; sourceTree = "<group>"; };
12812
		C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextEncodingDetectorICU.cpp; sourceTree = "<group>"; };
12813
		C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingDetector.h; sourceTree = "<group>"; };
12813
		C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingDetector.h; sourceTree = "<group>"; };
12814
		C330A22013EC196B0000B45B /* ColorChooser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ColorChooser.cpp; sourceTree = "<group>"; };
12815
		C330A22113EC196B0000B45B /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooser.h; sourceTree = "<group>"; };
12814
		C330A22113EC196B0000B45B /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooser.h; sourceTree = "<group>"; };
12815
		C37CDEBC149EF2030042090D /* ColorChooserClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooserClient.h; sourceTree = "<group>"; };
12816
		C50B561412119D23008B46E0 /* GroupSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GroupSettings.cpp; sourceTree = "<group>"; };
12816
		C50B561412119D23008B46E0 /* GroupSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GroupSettings.cpp; sourceTree = "<group>"; };
12817
		C50B561512119D23008B46E0 /* GroupSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupSettings.h; sourceTree = "<group>"; };
12817
		C50B561512119D23008B46E0 /* GroupSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GroupSettings.h; sourceTree = "<group>"; };
12818
		C50D0E800FF4272900AC2644 /* StorageNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespace.cpp; sourceTree = "<group>"; };
12818
		C50D0E800FF4272900AC2644 /* StorageNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespace.cpp; sourceTree = "<group>"; };
Lines 20233-20240 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec3
20233
				89D08D9D12228451001241DF /* AsyncFileSystem.h */,
20233
				89D08D9D12228451001241DF /* AsyncFileSystem.h */,
20234
				89D08D9E12228451001241DF /* AsyncFileSystemCallbacks.h */,
20234
				89D08D9E12228451001241DF /* AsyncFileSystemCallbacks.h */,
20235
				51E1ECB10C91C55600DC255B /* AutodrainedPool.h */,
20235
				51E1ECB10C91C55600DC255B /* AutodrainedPool.h */,
20236
				C330A22013EC196B0000B45B /* ColorChooser.cpp */,
20237
				C330A22113EC196B0000B45B /* ColorChooser.h */,
20236
				C330A22113EC196B0000B45B /* ColorChooser.h */,
20237
				C37CDEBC149EF2030042090D /* ColorChooserClient.h */,
20238
				BCC8CFCA0986CD2400140BF2 /* ColorData.gperf */,
20238
				BCC8CFCA0986CD2400140BF2 /* ColorData.gperf */,
20239
				41D015C90F4B5C71004A662F /* ContentType.cpp */,
20239
				41D015C90F4B5C71004A662F /* ContentType.cpp */,
20240
				41D015C80F4B5C71004A662F /* ContentType.h */,
20240
				41D015C80F4B5C71004A662F /* ContentType.h */,
Lines 24940-24945 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec4
24940
				49ECEB6C1499790D00CDD3A4 /* FELightingNEON.h in Headers */,
24940
				49ECEB6C1499790D00CDD3A4 /* FELightingNEON.h in Headers */,
24941
				1A2F9D7A14968C740065AC63 /* ScrollingCoordinator.h in Headers */,
24941
				1A2F9D7A14968C740065AC63 /* ScrollingCoordinator.h in Headers */,
24942
				1AA7160B149BC4DB0016EC19 /* TileCache.h in Headers */,
24942
				1AA7160B149BC4DB0016EC19 /* TileCache.h in Headers */,
24943
				C37CDEBD149EF2030042090D /* ColorChooserClient.h in Headers */,
24943
			);
24944
			);
24944
			runOnlyForDeploymentPostprocessing = 0;
24945
			runOnlyForDeploymentPostprocessing = 0;
24945
		};
24946
		};
Lines 25433-25439 a/Source/WebCore/WebCore.xcodeproj/project.pbxproj_sec5
25433
				93C441EF0F813A1A00C1A634 /* CollectionCache.cpp in Sources */,
25434
				93C441EF0F813A1A00C1A634 /* CollectionCache.cpp in Sources */,
25434
				B27535660B053814002CE64F /* Color.cpp in Sources */,
25435
				B27535660B053814002CE64F /* Color.cpp in Sources */,
25435
				0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */,
25436
				0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */,
25436
				C330A22213EC196B0000B45B /* ColorChooser.cpp in Sources */,
25437
				1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
25437
				1ABA76C911D20E47004C201C /* ColorData.cpp in Sources */,
25438
				B22279620D00BF220071B782 /* ColorDistance.cpp in Sources */,
25438
				B22279620D00BF220071B782 /* ColorDistance.cpp in Sources */,
25439
				F55B3DB31251F12D003EF269 /* ColorInputType.cpp in Sources */,
25439
				F55B3DB31251F12D003EF269 /* ColorInputType.cpp in Sources */,
- a/Source/WebCore/platform/ColorChooser.cpp -87 lines
Lines 1-87 a/Source/WebCore/platform/ColorChooser.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 Apple Computer, Inc. ("Apple") 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 APPLE 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
30
#include "config.h"
31
#include "ColorChooser.h"
32
33
#include <wtf/PassOwnPtr.h>
34
35
#if ENABLE(INPUT_COLOR)
36
37
namespace WebCore {
38
39
ColorChooserClient::~ColorChooserClient()
40
{
41
    discardChooser();
42
}
43
44
ColorChooser* ColorChooserClient::newColorChooser()
45
{
46
    discardChooser();
47
48
    m_chooser = ColorChooser::create(this);
49
    return m_chooser.get();
50
}
51
52
void ColorChooserClient::discardChooser()
53
{
54
    if (m_chooser)
55
        m_chooser->disconnectClient();
56
    m_chooser.clear();
57
}
58
59
inline ColorChooser::ColorChooser(ColorChooserClient* client)
60
    : m_client(client)
61
{
62
}
63
64
PassRefPtr<ColorChooser> ColorChooser::create(ColorChooserClient* client)
65
{
66
    return adoptRef(new ColorChooser(client));
67
}
68
69
ColorChooser::~ColorChooser()
70
{
71
}
72
73
void ColorChooser::didChooseColor(const Color& color)
74
{
75
    if (m_client)
76
        m_client->didChooseColor(color);
77
}
78
79
void ColorChooser::didCleanup()
80
{
81
    if (m_client)
82
        m_client->didCleanup();
83
}
84
85
}
86
87
#endif // ENABLE(INPUT_COLOR)
- a/Source/WebKit/chromium/WebKit.gyp +6 lines
Lines 106-111 a/Source/WebKit/chromium/WebKit.gyp_sec1
106
                'public/WebBindings.h',
106
                'public/WebBindings.h',
107
                'public/WebBlob.h',
107
                'public/WebBlob.h',
108
                'public/WebCache.h',
108
                'public/WebCache.h',
109
                'public/WebColorChooser.h',
110
                'public/WebColorChooserClient.h',
109
                'public/WebCommonWorkerClient.h',
111
                'public/WebCommonWorkerClient.h',
110
                'public/WebCompositionUnderline.h',
112
                'public/WebCompositionUnderline.h',
111
                'public/WebCompositor.h',
113
                'public/WebCompositor.h',
Lines 370-375 a/Source/WebKit/chromium/WebKit.gyp_sec2
370
                'src/CCThreadImpl.h',
372
                'src/CCThreadImpl.h',
371
                'src/ChromeClientImpl.cpp',
373
                'src/ChromeClientImpl.cpp',
372
                'src/ChromeClientImpl.h',
374
                'src/ChromeClientImpl.h',
375
                'src/ColorChooserProxy.cpp',
376
                'src/ColorChooserProxy.h',
373
                'src/ChromiumCurrentTime.cpp',
377
                'src/ChromiumCurrentTime.cpp',
374
                'src/ChromiumOSRandomSource.cpp',
378
                'src/ChromiumOSRandomSource.cpp',
375
                'src/ChromiumThreading.cpp',
379
                'src/ChromiumThreading.cpp',
Lines 481-486 a/Source/WebKit/chromium/WebKit.gyp_sec3
481
                'src/WebBlobData.cpp',
485
                'src/WebBlobData.cpp',
482
                'src/WebCache.cpp',
486
                'src/WebCache.cpp',
483
                'src/WebColor.cpp',
487
                'src/WebColor.cpp',
488
                'src/WebColorChooserClientImpl.cpp',
489
                'src/WebColorChooserClientImpl.h',
484
                'src/WebCommon.cpp',
490
                'src/WebCommon.cpp',
485
                'src/WebCompositorImpl.cpp',
491
                'src/WebCompositorImpl.cpp',
486
                'src/WebCompositorImpl.h',
492
                'src/WebCompositorImpl.h',
- a/Source/WebKit/chromium/features.gypi +1 lines
Lines 53-58 a/Source/WebKit/chromium/features.gypi_sec1
53
      'ENABLE_GESTURE_RECOGNIZER=1',
53
      'ENABLE_GESTURE_RECOGNIZER=1',
54
      'ENABLE_ICONDATABASE=0',
54
      'ENABLE_ICONDATABASE=0',
55
      'ENABLE_INDEXED_DATABASE=1',
55
      'ENABLE_INDEXED_DATABASE=1',
56
      'ENABLE_INPUT_COLOR=0',
56
      'ENABLE_INPUT_SPEECH=1',
57
      'ENABLE_INPUT_SPEECH=1',
57
      'ENABLE_INPUT_TYPE_COLOR=0',
58
      'ENABLE_INPUT_TYPE_COLOR=0',
58
      'ENABLE_INPUT_TYPE_DATE=0',
59
      'ENABLE_INPUT_TYPE_DATE=0',
- a/Source/WebKit/chromium/public/WebColorChooser.h +49 lines
Line 0 a/Source/WebKit/chromium/public/WebColorChooser.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
 *
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 WebColorChooser_h
27
#define WebColorChooser_h
28
29
#include "platform/WebColor.h"
30
#include "platform/WebCommon.h"
31
32
namespace WebKit {
33
34
// This represents a color chooser.
35
class WebColorChooser {
36
public:
37
    virtual ~WebColorChooser() { }
38
39
    // Set selected color in the color chooser.
40
    virtual void setSelectedColor(const WebColor color) { }
41
42
    // Calling this ends the color chooser and the client won't be recieving
43
    // didChooseColor callbacks anymore.
44
    virtual void endChooser() { }
45
};
46
47
}
48
49
#endif // WebColorChooser_h
- a/Source/WebKit/chromium/public/WebColorChooserClient.h +48 lines
Line 0 a/Source/WebKit/chromium/public/WebColorChooserClient.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
 *
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 WebColorChooserClient_h
27
#define WebColorChooserClient_h
28
29
#include "platform/WebColor.h"
30
#include "platform/WebCommon.h"
31
32
namespace WebKit {
33
34
// Receives calls from WebColorChooser and passes it to the WebCore side.
35
class WebColorChooserClient {
36
public:
37
    virtual ~WebColorChooserClient() { }
38
39
    // Called when user selects a color in the color chooser.
40
    virtual void didChooseColor(const WebColor&) { }
41
42
    // Called when color chooser has ended.
43
    virtual void didEndChooser() { }
44
};
45
46
}
47
48
#endif // WebColorChooserClient_h
- a/Source/WebKit/chromium/public/WebViewClient.h -1 / +10 lines
Lines 41-51 a/Source/WebKit/chromium/public/WebViewClient.h_sec1
41
#include "WebTextAffinity.h"
41
#include "WebTextAffinity.h"
42
#include "WebTextDirection.h"
42
#include "WebTextDirection.h"
43
#include "WebWidgetClient.h"
43
#include "WebWidgetClient.h"
44
#include "platform/WebColor.h"
44
#include "platform/WebString.h"
45
#include "platform/WebString.h"
45
46
46
namespace WebKit {
47
namespace WebKit {
47
48
48
class WebAccessibilityObject;
49
class WebAccessibilityObject;
50
class WebColorChooser;
51
class WebColorChooserClient;
49
class WebDeviceOrientationClient;
52
class WebDeviceOrientationClient;
50
class WebDragData;
53
class WebDragData;
51
class WebElement;
54
class WebElement;
Lines 177-185 public: a/Source/WebKit/chromium/public/WebViewClient.h_sec2
177
    // indicating that the default action should be suppressed.
180
    // indicating that the default action should be suppressed.
178
    virtual bool handleCurrentKeyboardEvent() { return false; }
181
    virtual bool handleCurrentKeyboardEvent() { return false; }
179
182
180
181
    // Dialogs -------------------------------------------------------------
183
    // Dialogs -------------------------------------------------------------
182
184
185
    // This method opens the color chooser and returns a new WebColorChooser
186
    // instance. If there is a WebColorChooser already from the last time this
187
    // was called, it ends the color chooser by calling endChooser, and replaces
188
    // it with the new one.
189
    virtual WebColorChooser* createColorChooser(WebColorChooserClient*,
190
                                                const WebColor&) { return 0; }
191
183
    // This method returns immediately after showing the dialog. When the
192
    // This method returns immediately after showing the dialog. When the
184
    // dialog is closed, it should call the WebFileChooserCompletion to
193
    // dialog is closed, it should call the WebFileChooserCompletion to
185
    // pass the results of the dialog. Returns false if
194
    // pass the results of the dialog. Returns false if
- a/Source/WebKit/chromium/src/ChromeClientImpl.cpp +24 lines
Lines 34-39 a/Source/WebKit/chromium/src/ChromeClientImpl.cpp_sec1
34
34
35
#include "AXObjectCache.h"
35
#include "AXObjectCache.h"
36
#include "AccessibilityObject.h"
36
#include "AccessibilityObject.h"
37
#if ENABLE(INPUT_COLOR)
38
#include "ColorChooser.h"
39
#include "ColorChooserClient.h"
40
#include "ColorChooserProxy.h"
41
#endif
37
#include "Console.h"
42
#include "Console.h"
38
#include "Cursor.h"
43
#include "Cursor.h"
39
#include "DatabaseTracker.h"
44
#include "DatabaseTracker.h"
Lines 68-73 a/Source/WebKit/chromium/src/ChromeClientImpl.cpp_sec2
68
#include "V8Proxy.h"
73
#include "V8Proxy.h"
69
#endif
74
#endif
70
#include "WebAccessibilityObject.h"
75
#include "WebAccessibilityObject.h"
76
#if ENABLE(INPUT_COLOR)
77
#include "WebColorChooser.h"
78
#include "WebColorChooserClientImpl.h"
79
#endif
71
#include "WebConsoleMessage.h"
80
#include "WebConsoleMessage.h"
72
#include "WebCursorInfo.h"
81
#include "WebCursorInfo.h"
73
#include "WebFileChooserCompletionImpl.h"
82
#include "WebFileChooserCompletionImpl.h"
Lines 675-680 void ChromeClientImpl::reachedApplicationCacheOriginQuota(SecurityOrigin*, int64 a/Source/WebKit/chromium/src/ChromeClientImpl.cpp_sec3
675
    ASSERT_NOT_REACHED();
684
    ASSERT_NOT_REACHED();
676
}
685
}
677
686
687
#if ENABLE(INPUT_COLOR)
688
PassOwnPtr<ColorChooser> ChromeClientImpl::createColorChooser(ColorChooserClient* chooserClient, const Color& initialColor)
689
{
690
    WebViewClient* client = m_webView->client();
691
    if (!client)
692
        return nullptr;
693
    WebColorChooserClientImpl* chooserClientProxy = new WebColorChooserClientImpl(chooserClient);
694
    WebColor webColor = static_cast<WebColor>(initialColor.rgb());
695
    WebColorChooser* chooser = client->createColorChooser(chooserClientProxy, webColor);
696
    if (!chooser)
697
        return nullptr;
698
    return adoptPtr(new ColorChooserProxy(adoptPtr(chooser)));
699
}
700
#endif
701
678
void ChromeClientImpl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> fileChooser)
702
void ChromeClientImpl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> fileChooser)
679
{
703
{
680
    WebViewClient* client = m_webView->client();
704
    WebViewClient* client = m_webView->client();
- a/Source/WebKit/chromium/src/ChromeClientImpl.h +7 lines
Lines 38-43 a/Source/WebKit/chromium/src/ChromeClientImpl.h_sec1
38
38
39
namespace WebCore {
39
namespace WebCore {
40
class AccessibilityObject;
40
class AccessibilityObject;
41
#if ENABLE(INPUT_COLOR)
42
class ColorChooser;
43
class ColorChooserClient;
44
#endif
41
class Element;
45
class Element;
42
class FileChooser;
46
class FileChooser;
43
class PopupContainer;
47
class PopupContainer;
Lines 134-139 public: a/Source/WebKit/chromium/src/ChromeClientImpl.h_sec2
134
    virtual bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&);
138
    virtual bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&);
135
    virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
139
    virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
136
    virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
140
    virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
141
#if ENABLE(INPUT_COLOR)
142
    virtual PassOwnPtr<WebCore::ColorChooser> createColorChooser(WebCore::ColorChooserClient*, const WebCore::Color&) OVERRIDE;
143
#endif
137
    virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
144
    virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
138
    virtual void loadIconForFiles(const Vector<WTF::String>&, WebCore::FileIconLoader*);
145
    virtual void loadIconForFiles(const Vector<WTF::String>&, WebCore::FileIconLoader*);
139
#if ENABLE(DIRECTORY_UPLOAD)
146
#if ENABLE(DIRECTORY_UPLOAD)
- a/Source/WebKit/chromium/src/ColorChooserProxy.cpp +62 lines
Line 0 a/Source/WebKit/chromium/src/ColorChooserProxy.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
 *
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 "ColorChooserProxy.h"
28
29
#include "Color.h"
30
#include "WebColorChooser.h"
31
#include "platform/WebColor.h"
32
33
#if ENABLE(INPUT_COLOR)
34
35
namespace WebKit {
36
37
ColorChooserProxy::ColorChooserProxy(PassOwnPtr<WebColorChooser> chooser) : m_chooser(chooser)
38
{
39
}
40
41
ColorChooserProxy::~ColorChooserProxy()
42
{
43
}
44
45
void ColorChooserProxy::setSelectedColor(const WebCore::Color& color)
46
{
47
    if (!m_chooser)
48
        return;
49
    WebColor webColor = static_cast<WebColor>(color.rgb());
50
    m_chooser->setSelectedColor(webColor);
51
}
52
53
void ColorChooserProxy::endChooser()
54
{
55
    if (!m_chooser)
56
        return;
57
    m_chooser->endChooser();
58
}
59
60
}
61
62
#endif // ENABLE(INPUT_COLOR)
- a/Source/WebKit/chromium/src/ColorChooserProxy.h +54 lines
Line 0 a/Source/WebKit/chromium/src/ColorChooserProxy.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
 *
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 ColorChooserProxy_h
27
#define ColorChooserProxy_h
28
29
#include "ColorChooser.h"
30
#include "WebColorChooser.h"
31
#include <wtf/OwnPtr.h>
32
#include <wtf/PassOwnPtr.h>
33
34
#if ENABLE(INPUT_COLOR)
35
36
namespace WebKit {
37
38
class ColorChooserProxy : public WebCore::ColorChooser {
39
public:
40
    ColorChooserProxy(PassOwnPtr<WebColorChooser>);
41
    virtual ~ColorChooserProxy();
42
43
    virtual void setSelectedColor(const WebCore::Color&);
44
    virtual void endChooser();
45
46
private:
47
    OwnPtr<WebColorChooser> m_chooser;
48
};
49
50
} // namespace WebKit
51
52
#endif // ENABLE(INPUT_COLOR)
53
54
#endif // ColorChooserProxy_h
- a/Source/WebKit/chromium/src/WebColorChooserClientImpl.cpp +60 lines
Line 0 a/Source/WebKit/chromium/src/WebColorChooserClientImpl.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
 *
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 "WebColorChooserClientImpl.h"
28
29
#include "Color.h"
30
#include "ColorChooserClient.h"
31
32
#if ENABLE(INPUT_COLOR)
33
34
namespace WebKit {
35
36
WebColorChooserClientImpl::WebColorChooserClientImpl(WebCore::ColorChooserClient* client) : m_client(client)
37
{
38
}
39
40
WebColorChooserClientImpl::~WebColorChooserClientImpl()
41
{
42
}
43
44
void WebColorChooserClientImpl::didChooseColor(const WebColor& color)
45
{
46
    if (!m_client)
47
        return;
48
    m_client->didChooseColor(WebCore::Color(static_cast<WebCore::RGBA32>(color)));
49
}
50
51
void WebColorChooserClientImpl::didEndChooser()
52
{
53
    if (!m_client)
54
        return;
55
    m_client->didEndChooser();
56
}
57
58
}
59
60
#endif // ENABLE(INPUT_COLOR)
- a/Source/WebKit/chromium/src/WebColorChooserClientImpl.h +55 lines
Line 0 a/Source/WebKit/chromium/src/WebColorChooserClientImpl.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
 *
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 WebColorChooserClientImpl_h
27
#define WebColorChooserClientImpl_h
28
29
#include "WebColorChooserClient.h"
30
31
#if ENABLE(INPUT_COLOR)
32
33
namespace WebCore {
34
class ColorChooserClient;
35
}
36
37
namespace WebKit {
38
39
class WebColorChooserClientImpl : public WebColorChooserClient {
40
public:
41
    WebColorChooserClientImpl(WebCore::ColorChooserClient*);
42
    virtual ~WebColorChooserClientImpl();
43
44
    virtual void didChooseColor(const WebColor&) OVERRIDE;
45
    virtual void didEndChooser() OVERRIDE;
46
47
private:
48
    WebCore::ColorChooserClient* m_client;
49
};
50
51
}
52
53
#endif // ENABLE(INPUT_COLOR)
54
55
#endif // WebColorChooserClientImpl_h

Return to Bug 65897