Add WK api to get capture attribute for supporting HTML media capture
authorKihong Kwon <kihong.kwon@samsung.com>
Thu, 16 Aug 2012 02:13:04 +0000 (11:13 +0900)
committerSeonae Kim <sunaeluv.kim@samsung.com>
Fri, 24 Aug 2012 08:44:12 +0000 (17:44 +0900)
[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
Source/WebKit2/Shared/WebOpenPanelParameters.cpp
Source/WebKit2/Shared/WebOpenPanelParameters.h
Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.cpp
Source/WebKit2/UIProcess/API/C/WKOpenPanelParameters.h

index 3cb57b0..3dd4b84 100644 (file)
@@ -534,6 +534,9 @@ void ArgumentCoder<FileChooserSettings>::encode(ArgumentEncoder* encoder, const
 #endif
     encoder->encode(settings.acceptMIMETypes);
     encoder->encode(settings.selectedFiles);
+#if ENABLE(MEDIA_CAPTURE)
+    encoder->encode(settings.capture);
+#endif
 }
 
 bool ArgumentCoder<FileChooserSettings>::decode(ArgumentDecoder* decoder, FileChooserSettings& settings)
@@ -548,6 +551,10 @@ bool ArgumentCoder<FileChooserSettings>::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;
 }
index f6722bb..7725040 100644 (file)
@@ -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<ImmutableArray> WebOpenPanelParameters::acceptMIMETypes() const
     return ImmutableArray::adopt(vector);
 }
 
+#if ENABLE(MEDIA_CAPTURE)
+String WebOpenPanelParameters::capture() const
+{
+    return m_settings.capture;
+}
+#endif
+
+
 } // namespace WebCore
index eca44e1..ab12c0f 100644 (file)
@@ -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<ImmutableArray> acceptMIMETypes() const;
     Vector<String> selectedFileNames() const { return m_settings.selectedFiles; }
+#if ENABLE(MEDIA_CAPTURE)
+    String capture() const;
+#endif
 
 private:
     explicit WebOpenPanelParameters(const WebCore::FileChooserSettings&);
index c6f7a66..6a7c53e 100644 (file)
@@ -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
+}
index 64577ba..ddcaae2 100644 (file)
@@ -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