summaryrefslogtreecommitdiffstats
path: root/content/browser/android
diff options
context:
space:
mode:
authorkeishi@chromium.org <keishi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-04 06:04:13 +0000
committerkeishi@chromium.org <keishi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-04 06:04:13 +0000
commite8072568409f3d3613d10342bb6273b71fa403f2 (patch)
tree0927a778afe97a02497151f39323bc97a3bda9ef /content/browser/android
parentda491e57cbbc2c60b4320e8a7ecf54184148a825 (diff)
downloadchromium_src-e8072568409f3d3613d10342bb6273b71fa403f2.zip
chromium_src-e8072568409f3d3613d10342bb6273b71fa403f2.tar.gz
chromium_src-e8072568409f3d3613d10342bb6273b71fa403f2.tar.bz2
Transfer date/time value to chooser as double
BUG=324151 Review URL: https://codereview.chromium.org/85643002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238594 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/android')
-rw-r--r--content/browser/android/date_time_chooser_android.cc53
-rw-r--r--content/browser/android/date_time_chooser_android.h28
2 files changed, 18 insertions, 63 deletions
diff --git a/content/browser/android/date_time_chooser_android.cc b/content/browser/android/date_time_chooser_android.cc
index be87a93..87f02b9f 100644
--- a/content/browser/android/date_time_chooser_android.cc
+++ b/content/browser/android/date_time_chooser_android.cc
@@ -40,25 +40,7 @@ void DateTimeChooserAndroid::InitializeDateInputTypes(
void DateTimeChooserAndroid::ReplaceDateTime(JNIEnv* env,
jobject,
- int dialog_type,
- int year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- int milli,
- int week) {
- ViewHostMsg_DateTimeDialogValue_Params value;
- value.year = year;
- value.month = month;
- value.day = day;
- value.hour = hour;
- value.minute = minute;
- value.second = second;
- value.milli = milli;
- value.week = week;
- value.dialog_type = dialog_type;
+ jdouble value) {
host_->Send(new ViewMsg_ReplaceDateTime(host_->GetRoutingID(), value));
}
@@ -66,20 +48,14 @@ void DateTimeChooserAndroid::CancelDialog(JNIEnv* env, jobject) {
host_->Send(new ViewMsg_CancelDateTimeDialog(host_->GetRoutingID()));
}
-void DateTimeChooserAndroid::ShowDialog(ContentViewCore* content,
- RenderViewHost* host,
- int type,
- int year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- int milli,
- int week,
- double min,
- double max,
- double step) {
+void DateTimeChooserAndroid::ShowDialog(
+ ContentViewCore* content,
+ RenderViewHost* host,
+ ui::TextInputType dialog_type,
+ double dialog_value,
+ double min,
+ double max,
+ double step) {
host_ = host;
JNIEnv* env = AttachCurrentThread();
@@ -87,15 +63,8 @@ void DateTimeChooserAndroid::ShowDialog(ContentViewCore* content,
env,
content->GetJavaObject().obj(),
reinterpret_cast<intptr_t>(this),
- type,
- year,
- month,
- day,
- hour,
- minute,
- second,
- milli,
- week,
+ dialog_type,
+ dialog_value,
min,
max,
step));
diff --git a/content/browser/android/date_time_chooser_android.h b/content/browser/android/date_time_chooser_android.h
index a5578e0..a04850f 100644
--- a/content/browser/android/date_time_chooser_android.h
+++ b/content/browser/android/date_time_chooser_android.h
@@ -9,6 +9,7 @@
#include "base/android/jni_helper.h"
#include "base/memory/scoped_ptr.h"
+#include "ui/base/ime/text_input_type.h"
namespace content {
@@ -22,33 +23,18 @@ class DateTimeChooserAndroid {
~DateTimeChooserAndroid();
// DateTimeChooser implementation:
+ // Shows the dialog. |dialog_value| is the date/time value converted to a
+ // number as defined in HTML. (See blink::InputType::parseToNumber())
void ShowDialog(ContentViewCore* content,
RenderViewHost* host,
- int type,
- int year,
- int month,
- int day,
- int hour,
- int minute,
- int second,
- int milli,
- int week,
+ ui::TextInputType dialog_type,
+ double dialog_value,
double min,
double max,
double step);
- // Replaces the current value with the one passed the different fields
- void ReplaceDateTime(JNIEnv* env,
- jobject,
- jint dialog_type,
- jint year,
- jint month,
- jint day,
- jint hour,
- jint minute,
- jint second,
- jint milli,
- jint week);
+ // Replaces the current value
+ void ReplaceDateTime(JNIEnv* env, jobject, jdouble value);
// Closes the dialog without propagating any changes.
void CancelDialog(JNIEnv* env, jobject);