[WK2] Add getter for capture attribute of input element
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 07:17:54 +0000 (07:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Aug 2012 07:17:54 +0000 (07:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=93710

Patch by Kihong Kwon <kihong.kwon@samsung.com> on 2012-08-14
Reviewed by Antonio Gomes.

Add getter for capture attribute to WKOpenPanelParameters to support HTML Media Capture.

* Shared/WebCoreArgumentCoders.cpp:
(CoreIPC::::encode):
(CoreIPC::::decode):
* Shared/WebOpenPanelParameters.cpp:
(WebKit):
(WebKit::WebOpenPanelParameters::capture):
* Shared/WebOpenPanelParameters.h:
(WebOpenPanelParameters):
* UIProcess/API/C/WKOpenPanelParameters.cpp:
(WKOpenPanelParametersCopyCapture):
* UIProcess/API/C/WKOpenPanelParameters.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@125512 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
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 06060cb..8343684 100644 (file)
@@ -1,3 +1,24 @@
+2012-08-14  Kihong Kwon  <kihong.kwon@samsung.com>
+
+        [WK2] Add getter for capture attribute of input element
+        https://bugs.webkit.org/show_bug.cgi?id=93710
+
+        Reviewed by Antonio Gomes.
+
+        Add getter for capture attribute to WKOpenPanelParameters to support HTML Media Capture.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (CoreIPC::::encode):
+        (CoreIPC::::decode):
+        * Shared/WebOpenPanelParameters.cpp:
+        (WebKit):
+        (WebKit::WebOpenPanelParameters::capture):
+        * Shared/WebOpenPanelParameters.h:
+        (WebOpenPanelParameters):
+        * UIProcess/API/C/WKOpenPanelParameters.cpp:
+        (WKOpenPanelParametersCopyCapture):
+        * UIProcess/API/C/WKOpenPanelParameters.h:
+
 2012-08-13  Tom Sepez  <tsepez@chromium.org>
 
         [chromium] release FrameLoaderClientImpl::m_pluginWidget refptr upon Plugin Document detach.
index 7d40bc8..cbf6249 100644 (file)
@@ -555,6 +555,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)
@@ -569,6 +572,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