return;
ui::EventResult result = (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) ?
- ui::ER_HANDLED : ui::ER_UNHANDLED;
+ ui::ER_HANDLED : ui::ER_UNHANDLED;
for (ScopedVector<ui::TouchEvent>::const_iterator iter = events.begin(),
end = events.end(); iter != end; ++iter) {
scoped_ptr<ui::GestureRecognizer::Gestures> gestures(
- gesture_recognizer_->ProcessTouchEventForGesture(*(*iter), result, this));
+ gesture_recognizer_->ProcessTouchEventForGesture(*(*iter), result, this));
if (gestures) {
for (size_t j = 0; j < gestures->size(); ++j) {
ui::GestureEvent* event = gestures->get().at(j);
RenderViewHost* render_view_host = web_contents_delegate()->web_contents()->GetRenderViewHost();
if (!render_view_host)
return;
-
+#if defined(OS_TIZEN_MOBILE)
+ //If capture type is camcorder, launch camera instead of file chooser.
+ if (params.capture) {
+ std::vector<base::string16>::iterator it;
+ std::vector<base::string16> accept_types = params.accept_types;
+ it = accept_types.begin();
+ base::string16 filechoosertype = *it;
+ filechooser_mode_ = params.mode;
+ LaunchCamera(filechoosertype);
+ return;
+ }
+#endif
file_chooser_.reset(new content::FileChooserControllerEfl(render_view_host, ¶ms));
file_chooser_->open();
}
;
return html;
}
+
+#if defined(OS_TIZEN_MOBILE)
+void EWebView::cameraResultCb(service_h request,
+ service_h reply,
+ service_result_e result,
+ void* data)
+{
+ EWebView* webview = static_cast<EWebView*>(data);
+ if (result == SERVICE_RESULT_SUCCEEDED) {
+ int ret = -1;
+ char** filesarray;
+ int number;
+ ret =service_get_extra_data_array(reply, SERVICE_DATA_SELECTED,
+ &filesarray,&number);
+ if (filesarray) {
+ for(int i =0; i< number;i++) {
+ std::vector<ui::SelectedFileInfo> files;
+ RenderViewHost* render_view_host = webview->web_contents_delegate()->
+ web_contents()->GetRenderViewHost();
+ if (!render_view_host) {
+ return;
+ }
+ if (filesarray[i]) {
+ GURL url(filesarray[i]);
+ if (!url.is_valid()) {
+ base::FilePath path(url.SchemeIsFile() ? url.path() :
+ filesarray[i]);
+ files.push_back(ui::SelectedFileInfo(path, base::FilePath()));
+ }
+ }
+ render_view_host->FilesSelectedInChooser(files,
+ webview->filechooser_mode_);
+ }
+ }
+ } else {
+ RenderViewHost* render_view_host = webview->web_contents_delegate()->
+ web_contents()->GetRenderViewHost();
+ std::vector<ui::SelectedFileInfo> files;
+ if (render_view_host) {
+ render_view_host->FilesSelectedInChooser(files,
+ webview->filechooser_mode_);
+ }
+ }
+}
+
+bool EWebView::LaunchCamera(base::string16 mimetype)
+{
+ service_h svcHandle = 0;
+ if (service_create(&svcHandle) < 0 || !svcHandle) {
+ LOG(ERROR) << __FUNCTION__ << " Service Creation Failed ";
+ return false;
+ }
+ service_set_operation(svcHandle, SERVICE_OPERATION_CREATE_CONTENT);
+ service_set_mime(svcHandle, UTF16ToUTF8(mimetype).c_str());
+ service_add_extra_data(svcHandle, "CALLER", "Browser");
+
+ int ret = service_send_launch_request(svcHandle, cameraResultCb, this);
+ if (ret != SERVICE_ERROR_NONE) {
+ LOG(ERROR) << __FUNCTION__ << " Service Launch Failed ";
+ service_destroy(svcHandle);
+ return false;
+ }
+ service_destroy(svcHandle);
+ return true;
+}
+#endif
#ifndef EWEB_VIEW_H
#define EWEB_VIEW_H
+#if defined(OS_TIZEN_MOBILE)
+#include <appfw/app_service.h>
+#include <vector>
+#endif
+
#include <map>
#include <string>
#include <Evas.h>
static void OnTouchDown(void*, Evas*, Evas_Object*, void*);
static void OnTouchUp(void*, Evas*, Evas_Object*, void*);
static void OnTouchMove(void*, Evas*, Evas_Object*, void*);
+#if defined(OS_TIZEN_MOBILE)
+ static void cameraResultCb(service_h request, service_h reply,
+ service_result_e result, void* data);
+#endif
void HandleTouchEvents(Ewk_Touch_Event_Type);
virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE;
virtual void DispatchGestureEvent(ui::GestureEvent*) OVERRIDE;
+#if defined(OS_TIZEN_MOBILE)
+ bool LaunchCamera(base::string16 mimetype);
+#endif
content::RenderWidgetHostViewEfl* rwhv() const;
JavaScriptDialogManagerEfl* GetJavaScriptDialogManagerEfl();
#ifndef NDEBUG
bool renderer_crashed_;
#endif
+#if defined(OS_TIZEN_MOBILE)
+ content::FileChooserParams::Mode filechooser_mode_;
+#endif
};
bool IsEWebViewObject(const Evas_Object*);