From: Arnaud Renevier Date: Sat, 28 Feb 2015 05:32:48 +0000 (-0800) Subject: Remove tw_input_type.h X-Git-Tag: submit/tizen/20201118.160233~1141 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9972025420e0878df662afc8899e2d6ee848082f;p=platform%2Fframework%2Fweb%2Fchromium-efl.git Remove tw_input_type.h This patch remove tw_input_type.h. We can easily use ui::TextInputType instead. Reviewed by: Antonio Gomes, Piotr Tworek Change-Id: I2072200f74cbada0618674f43da31445f1708d68 Signed-off-by: Arnaud Renevier --- diff --git a/tizen_src/impl/browser/inputpicker/InputPicker.cc b/tizen_src/impl/browser/inputpicker/InputPicker.cc index f5c1c58..053701d 100755 --- a/tizen_src/impl/browser/inputpicker/InputPicker.cc +++ b/tizen_src/impl/browser/inputpicker/InputPicker.cc @@ -320,21 +320,34 @@ void InputPicker::endEditingCallback( #endif void InputPicker::showDatePicker( - tizen_webview::Input_Type input_type, double input_date) { + ui::TextInputType input_type, double input_date) { + web_view_.ExecuteEditCommand("Unselect", 0); - if (input_type == TW_INPUT_TYPE_DATE) - showDatePopup(input_date); - else if (input_type == TW_INPUT_TYPE_TIME) - showTimePopup(input_date); - else if (input_type == TW_INPUT_TYPE_DATETIME) - showDatetimePopup(input_date, false); - else if (input_type == TW_INPUT_TYPE_DATETIMELOCAL) - showDatetimePopup(input_date, true); - else if (input_type == TW_INPUT_TYPE_MONTH) - showMonthPopup(input_date); - else if (input_type == TW_INPUT_TYPE_WEEK) - showWeekPopup(input_date); + switch (input_type) { + case ui::TEXT_INPUT_TYPE_DATE: + showDatePopup(input_date); + break; + case ui::TEXT_INPUT_TYPE_DATE_TIME_FIELD: + case ui::TEXT_INPUT_TYPE_DATE_TIME: + showDatetimePopup(input_date, false); + break; + case ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL: + showDatetimePopup(input_date, true); + break; + case ui::TEXT_INPUT_TYPE_TIME: + showTimePopup(input_date); + break; + case ui::TEXT_INPUT_TYPE_WEEK: + showWeekPopup(input_date); + break; + case ui::TEXT_INPUT_TYPE_MONTH: + showMonthPopup(input_date); + break; + default: + break; + } + } void InputPicker::ShowColorPicker(int r, int g, int b, int alpha) { diff --git a/tizen_src/impl/browser/inputpicker/InputPicker.h b/tizen_src/impl/browser/inputpicker/InputPicker.h index fde4901..0c3afdf 100755 --- a/tizen_src/impl/browser/inputpicker/InputPicker.h +++ b/tizen_src/impl/browser/inputpicker/InputPicker.h @@ -7,8 +7,7 @@ #include #include - -#include "tizen_webview/public/tw_input_type.h" +#include "ui/base/ime/text_input_type.h" class EWebView; @@ -24,7 +23,7 @@ class InputPicker { ~InputPicker(); void showDatePicker( - tizen_webview::Input_Type input_type, double input_date); + ui::TextInputType input_type, double input_date); void ShowColorPicker(int r, int g, int b, int alpha); void HideColorPicker(); void SetPopupSize(int width, int height); diff --git a/tizen_src/impl/eweb_view.cc b/tizen_src/impl/eweb_view.cc index 41dd834..26afc95 100644 --- a/tizen_src/impl/eweb_view.cc +++ b/tizen_src/impl/eweb_view.cc @@ -2151,7 +2151,8 @@ bool EWebView::SetColorPickerColor(int r, int g, int b, int a) { } void EWebView::InputPickerShow( - tizen_webview::Input_Type input_type, double input_value) { + ui::TextInputType input_type, double input_value) { + inputPicker_.reset(new InputPicker(*this)); inputPicker_->showDatePicker(input_type, input_value); } diff --git a/tizen_src/impl/eweb_view.h b/tizen_src/impl/eweb_view.h index e387a7c..edede6e 100644 --- a/tizen_src/impl/eweb_view.h +++ b/tizen_src/impl/eweb_view.h @@ -66,7 +66,6 @@ #include "tizen_webview/public/tw_callbacks.h" #include "tizen_webview/public/tw_content_security_policy.h" #include "tizen_webview/public/tw_frame.h" -#include "tizen_webview/public/tw_input_type.h" #include "tizen_webview/public/tw_find_options.h" #include "tizen_webview/public/tw_touch_event.h" @@ -437,7 +436,7 @@ class EWebView { void DismissColorPicker(); bool SetColorPickerColor(int r, int g, int b, int a); void InputPickerShow( - tizen_webview::Input_Type input_type, double input_value); + ui::TextInputType input_type, double input_value); void FindAndRunSnapshotCallback(Evas_Object* image, int snapshotId); #ifdef TIZEN_EDGE_EFFECT diff --git a/tizen_src/impl/tizen_webview/public/tw_input_type.h b/tizen_src/impl/tizen_webview/public/tw_input_type.h deleted file mode 100644 index f548875..0000000 --- a/tizen_src/impl/tizen_webview/public/tw_input_type.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2014 The Chromium Authors. All rights reserved. -// Copyright 2014 Samsung Electronics. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef TIZEN_WEBVIEW_PUBLIC_TW_INPUT_TYPE_H_ -#define TIZEN_WEBVIEW_PUBLIC_TW_INPUT_TYPE_H_ - -namespace tizen_webview { - -// Provides type of focused input element -enum Input_Type { - TW_INPUT_TYPE_TEXT, - TW_INPUT_TYPE_TELEPHONE, - TW_INPUT_TYPE_NUMBER, - TW_INPUT_TYPE_EMAIL, - TW_INPUT_TYPE_URL, - TW_INPUT_TYPE_PASSWORD, - TW_INPUT_TYPE_COLOR, - TW_INPUT_TYPE_DATE, - TW_INPUT_TYPE_DATETIME, - TW_INPUT_TYPE_DATETIMELOCAL, - TW_INPUT_TYPE_MONTH, - TW_INPUT_TYPE_TIME, - TW_INPUT_TYPE_WEEK -}; - -} // namespace tizen_webview - -#endif // TIZEN_WEBVIEW_PUBLIC_TW_INPUT_TYPE_H_ diff --git a/tizen_src/impl/web_contents_delegate_efl.cc b/tizen_src/impl/web_contents_delegate_efl.cc index 324fcd5..c49b57f 100644 --- a/tizen_src/impl/web_contents_delegate_efl.cc +++ b/tizen_src/impl/web_contents_delegate_efl.cc @@ -32,7 +32,6 @@ #include "browser/favicon/favicon_service.h" #include "tizen_webview/public/tw_web_context.h" -#include "tizen_webview/public/tw_input_type.h" #if defined(OS_TIZEN) #include "content/public/browser/media_capture_devices.h" @@ -615,36 +614,6 @@ void WebContentsDelegateEfl::OpenDateTimeDialog( double step, const std::vector& suggestions) { int inputPickerType; - - switch (dialog_type) { - case ui::TEXT_INPUT_TYPE_DATE: - inputPickerType = TW_INPUT_TYPE_DATE; - break; - case ui::TEXT_INPUT_TYPE_DATE_TIME: - inputPickerType = TW_INPUT_TYPE_DATETIME; - break; - case ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL: - inputPickerType = TW_INPUT_TYPE_DATETIMELOCAL; - break; - case ui::TEXT_INPUT_TYPE_TIME: - inputPickerType = TW_INPUT_TYPE_TIME; - break; - case ui::TEXT_INPUT_TYPE_WEEK: - inputPickerType = TW_INPUT_TYPE_WEEK; - break; - case ui::TEXT_INPUT_TYPE_CONTENT_EDITABLE: - inputPickerType = TW_INPUT_TYPE_TEXT; - break; - case ui::TEXT_INPUT_TYPE_DATE_TIME_FIELD: - inputPickerType = TW_INPUT_TYPE_DATETIME; - break; - case ui::TEXT_INPUT_TYPE_MONTH: - inputPickerType = TW_INPUT_TYPE_MONTH; - break; - default: - inputPickerType = TW_INPUT_TYPE_TEXT; - break; - } - web_view_->InputPickerShow(static_cast(inputPickerType), dialog_value); + web_view_->InputPickerShow(dialog_type, dialog_value); } } //namespace content