From 710834e73385180847112318119606745a7103c4 Mon Sep 17 00:00:00 2001 From: Kihong Kwon Date: Thu, 16 Aug 2012 11:13:04 +0900 Subject: [PATCH] Add WK api to get capture attribute for supporting HTML media capture [Title] Add WK api to get capture attribute for supporting HTML media capture [Issue#] N/A [Problem] WK2 doesn't support HTML media capture [Cause] N/A [Solution] Early merge from webkit.org Change-Id: I2b7deb0f844cf3370c5979e00a3e0665bad30bca --- Source/WebKit2/Shared/WebCoreArgumentCoders.cpp | 7 +++++++ Source/WebKit2/Shared/WebOpenPanelParameters.cpp | 9 +++++++++ Source/WebKit2/Shared/WebOpenPanelParameters.h | 4 ++++ Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp | 10 ++++++++++ Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h | 3 +++ 5 files changed, 33 insertions(+) diff --git a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp index 3cb57b0..3dd4b84 100644 --- a/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp +++ b/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp @@ -534,6 +534,9 @@ void ArgumentCoder::encode(ArgumentEncoder* encoder, const #endif encoder->encode(settings.acceptMIMETypes); encoder->encode(settings.selectedFiles); +#if ENABLE(MEDIA_CAPTURE) + encoder->encode(settings.capture); +#endif } bool ArgumentCoder::decode(ArgumentDecoder* decoder, FileChooserSettings& settings) @@ -548,6 +551,10 @@ bool ArgumentCoder::decode(ArgumentDecoder* decoder, FileCh return false; if (!decoder->decode(settings.selectedFiles)) return false; +#if ENABLE(MEDIA_CAPTURE) + if (!decoder->decode(settings.capture)) + return false; +#endif return true; } diff --git a/Source/WebKit2/Shared/WebOpenPanelParameters.cpp b/Source/WebKit2/Shared/WebOpenPanelParameters.cpp index f6722bb..7725040 100644 --- a/Source/WebKit2/Shared/WebOpenPanelParameters.cpp +++ b/Source/WebKit2/Shared/WebOpenPanelParameters.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2012 Samsung Electronics. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -60,4 +61,12 @@ PassRefPtr WebOpenPanelParameters::acceptMIMETypes() const return ImmutableArray::adopt(vector); } +#if ENABLE(MEDIA_CAPTURE) +String WebOpenPanelParameters::capture() const +{ + return m_settings.capture; +} +#endif + + } // namespace WebCore diff --git a/Source/WebKit2/Shared/WebOpenPanelParameters.h b/Source/WebKit2/Shared/WebOpenPanelParameters.h index eca44e1..ab12c0f 100644 --- a/Source/WebKit2/Shared/WebOpenPanelParameters.h +++ b/Source/WebKit2/Shared/WebOpenPanelParameters.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2012 Samsung Electronics. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -45,6 +46,9 @@ public: bool allowMultipleFiles() const { return m_settings.allowsMultipleFiles; } PassRefPtr acceptMIMETypes() const; Vector selectedFileNames() const { return m_settings.selectedFiles; } +#if ENABLE(MEDIA_CAPTURE) + String capture() const; +#endif private: explicit WebOpenPanelParameters(const WebCore::FileChooserSettings&); diff --git a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp index c6f7a66..6a7c53e 100644 --- a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp +++ b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2012 Samsung Electronics. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,3 +47,12 @@ WKArrayRef WKOpenPanelParametersCopyAcceptedMIMETypes(WKOpenPanelParametersRef p { return toAPI(toImpl(parametersRef)->acceptMIMETypes().leakRef()); } + +WKStringRef WKOpenPanelParametersCopyCapture(WKOpenPanelParametersRef parametersRef) +{ +#if ENABLE(MEDIA_CAPTURE) + return toCopiedAPI(toImpl(parametersRef)->capture()); +#else + return 0; +#endif +} diff --git a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h index 64577ba..ddcaae2 100644 --- a/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h +++ b/Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2010 Apple Inc. All rights reserved. + * Copyright (C) 2012 Samsung Electronics. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -42,6 +43,8 @@ WK_EXPORT bool WKOpenPanelParametersGetAllowsMultipleFiles(WKOpenPanelParameters WK_EXPORT WKArrayRef WKOpenPanelParametersCopyAcceptedMIMETypes(WKOpenPanelParametersRef parameters); +WK_EXPORT WKStringRef WKOpenPanelParametersCopyCapture(WKOpenPanelParametersRef parameters); + #ifdef __cplusplus } #endif -- 2.7.4