Diff
Modified: trunk/Source/WebKit/efl/ChangeLog (123846 => 123847)
--- trunk/Source/WebKit/efl/ChangeLog 2012-07-27 07:51:54 UTC (rev 123846)
+++ trunk/Source/WebKit/efl/ChangeLog 2012-07-27 07:56:34 UTC (rev 123847)
@@ -1,3 +1,23 @@
+2012-07-27 Kihong Kwon <[email protected]>
+
+ [EFL] Change prototype of run_open_panel
+ https://bugs.webkit.org/show_bug.cgi?id=91956
+
+ Reviewed by Kentaro Hara.
+
+ In order to support all of the file chooser attributes,
+ change the types of parameters in run_open_panel method.
+ i.e., change "Eina_Bool allows_multiple_files, Eina_List *accept_types"
+ to "Ewk_File_Chooser *file_chooser"
+ In addition, Efl can support the capture attribute for HTML media capture.
+
+ * WebCoreSupport/ChromeClientEfl.cpp:
+ (WebCore::ChromeClientEfl::runOpenPanel):
+ * ewk/ewk_view.cpp:
+ (ewk_view_run_open_panel):
+ * ewk/ewk_view.h:
+ * ewk/ewk_view_private.h:
+
2012-07-26 Seokju Kwon <[email protected]>
[EFL] Highlight the element under mouse on web inspector
Modified: trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp (123846 => 123847)
--- trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp 2012-07-27 07:51:54 UTC (rev 123846)
+++ trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp 2012-07-27 07:56:34 UTC (rev 123847)
@@ -53,6 +53,7 @@
#include "ViewportArguments.h"
#include "WindowFeatures.h"
#include "ewk_custom_handler_private.h"
+#include "ewk_file_chooser_private.h"
#include "ewk_frame_private.h"
#include "ewk_private.h"
#include "ewk_security_origin_private.h"
@@ -474,17 +475,16 @@
{
RefPtr<FileChooser> chooser = prpFileChooser;
Eina_List* selectedFilenames = 0;
- void* filename;
- Vector<String> filenames;
-
- const FileChooserSettings& settings = chooser->settings();
- bool confirm = ewk_view_run_open_panel(m_view, kit(frame), settings.allowsMultipleFiles, settings.acceptMIMETypes, &selectedFilenames);
-
+ Ewk_File_Chooser* fileChooser = ewk_file_chooser_new(chooser.get());
+ bool confirm = ewk_view_run_open_panel(m_view, kit(frame), fileChooser, &selectedFilenames);
+ ewk_file_chooser_free(fileChooser);
if (!confirm)
return;
+ void* filename;
+ Vector<String> filenames;
EINA_LIST_FREE(selectedFilenames, filename) {
- filenames.append((char*)filename);
+ filenames.append(String::fromUTF8(static_cast<char*>(filename)));
free(filename);
}
Modified: trunk/Source/WebKit/efl/ewk/ewk_view.cpp (123846 => 123847)
--- trunk/Source/WebKit/efl/ewk/ewk_view.cpp 2012-07-27 07:51:54 UTC (rev 123846)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.cpp 2012-07-27 07:56:34 UTC (rev 123847)
@@ -3578,9 +3578,9 @@
*
* @return @false if user canceled file selection; @true if confirmed.
*/
-bool ewk_view_run_open_panel(Evas_Object* ewkView, Evas_Object* frame, bool allowsMultipleFiles, const WTF::Vector<WTF::String>& acceptMIMETypes, Eina_List** selectedFilenames)
+bool ewk_view_run_open_panel(Evas_Object* ewkView, Evas_Object* frame, Ewk_File_Chooser* fileChooser, Eina_List** selectedFilenames)
{
- DBG("ewkView=%p frame=%p allows_multiple_files=%d", ewkView, frame, allowsMultipleFiles);
+ DBG("ewkView=%p frame=%p allows_multiple_files=%d", ewkView, frame, ewk_file_chooser_allows_multiple_files_get(fileChooser));
EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, false);
EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->api, false);
@@ -3588,19 +3588,10 @@
return false;
*selectedFilenames = 0;
-
- Eina_List* cAcceptMIMETypes = 0;
- for (WTF::Vector<WTF::String>::const_iterator iterator = acceptMIMETypes.begin(); iterator != acceptMIMETypes.end(); ++iterator)
- cAcceptMIMETypes = eina_list_append(cAcceptMIMETypes, eina_stringshare_add((*iterator).utf8().data()));
-
- bool confirm = smartData->api->run_open_panel(smartData, frame, allowsMultipleFiles, cAcceptMIMETypes, selectedFilenames);
+ bool confirm = smartData->api->run_open_panel(smartData, frame, fileChooser, selectedFilenames);
if (!confirm && *selectedFilenames)
ERR("Canceled file selection, but selected filenames != 0. Free names before return.");
- void* item = 0;
- EINA_LIST_FREE(cAcceptMIMETypes, item)
- eina_stringshare_del(static_cast<const char*>(item));
-
return confirm;
}
Modified: trunk/Source/WebKit/efl/ewk/ewk_view.h (123846 => 123847)
--- trunk/Source/WebKit/efl/ewk/ewk_view.h 2012-07-27 07:51:54 UTC (rev 123846)
+++ trunk/Source/WebKit/efl/ewk/ewk_view.h 2012-07-27 07:56:34 UTC (rev 123847)
@@ -113,6 +113,7 @@
#ifndef ewk_view_h
#define ewk_view_h
+#include "ewk_file_chooser.h"
#include "ewk_frame.h"
#include "ewk_history.h"
#include "ewk_js.h"
@@ -187,7 +188,7 @@
int64_t (*exceeded_application_cache_quota)(Ewk_View_Smart_Data *sd, Ewk_Security_Origin* origin, int64_t defaultOriginQuota, int64_t totalSpaceNeeded);
uint64_t (*exceeded_database_quota)(Ewk_View_Smart_Data *sd, Evas_Object *frame, const char *databaseName, uint64_t current_size, uint64_t expected_size);
- Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Eina_Bool allows_multiple_files, Eina_List *accept_types, Eina_List **selected_filenames);
+ Eina_Bool (*run_open_panel)(Ewk_View_Smart_Data *sd, Evas_Object *frame, Ewk_File_Chooser *file_chooser, Eina_List **selected_filenames);
Eina_Bool (*navigation_policy_decision)(Ewk_View_Smart_Data *sd, Ewk_Frame_Resource_Request *request, Ewk_Navigation_Type navigation_type);
Eina_Bool (*focus_can_cycle)(Ewk_View_Smart_Data *sd, Ewk_Focus_Direction direction);
@@ -197,7 +198,7 @@
* The version you have to put into the version field
* in the @a Ewk_View_Smart_Class structure.
*/
-#define EWK_VIEW_SMART_CLASS_VERSION 5UL
+#define EWK_VIEW_SMART_CLASS_VERSION 6UL
/**
* Initializes a whole @a Ewk_View_Smart_Class structure.
Modified: trunk/Source/WebKit/efl/ewk/ewk_view_private.h (123846 => 123847)
--- trunk/Source/WebKit/efl/ewk/ewk_view_private.h 2012-07-27 07:51:54 UTC (rev 123846)
+++ trunk/Source/WebKit/efl/ewk/ewk_view_private.h 2012-07-27 07:56:34 UTC (rev 123847)
@@ -97,7 +97,7 @@
int64_t ewk_view_exceeded_application_cache_quota(Evas_Object* ewkView, Ewk_Security_Origin *origin, int64_t defaultOriginQuota, int64_t totalSpaceNeeded);
uint64_t ewk_view_exceeded_database_quota(Evas_Object* ewkView, Evas_Object* frame, const char* databaseName, uint64_t currentSize, uint64_t expectedSize);
-bool ewk_view_run_open_panel(Evas_Object* ewkView, Evas_Object* frame, bool allowsMultipleFiles, const Vector<String>& acceptMIMETypes, Eina_List** selectedFilenames);
+bool ewk_view_run_open_panel(Evas_Object* ewkView, Evas_Object* frame, Ewk_File_Chooser* fileChooser, Eina_List** selectedFilenames);
void ewk_view_repaint(Evas_Object* ewkView, Evas_Coord x, Evas_Coord y, Evas_Coord width, Evas_Coord height);
void ewk_view_scroll(Evas_Object* ewkView, Evas_Coord deltaX, Evas_Coord deltaY, Evas_Coord scrollX, Evas_Coord scrollY, Evas_Coord scrollWidth, Evas_Coord scrollHeight, Evas_Coord centerX, Evas_Coord centerY, Evas_Coord centerW, Evas_Coord centerHeight);