OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.content.browser.input; | 5 package org.chromium.content.browser.input; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 | 8 |
9 import org.chromium.base.CalledByNative; | 9 import org.chromium.base.CalledByNative; |
10 import org.chromium.base.JNINamespace; | 10 import org.chromium.base.JNINamespace; |
(...skipping 20 matching lines...) Expand all Loading... | |
31 } | 31 } |
32 | 32 |
33 @Override | 33 @Override |
34 public void cancelDateTimeDialog() { | 34 public void cancelDateTimeDialog() { |
35 nativeCancelDialog(mNativeDateTimeChooserAndroid); | 35 nativeCancelDialog(mNativeDateTimeChooserAndroid); |
36 } | 36 } |
37 }); | 37 }); |
38 } | 38 } |
39 | 39 |
40 private void showDialog(int dialogType, double dialogValue, | 40 private void showDialog(int dialogType, double dialogValue, |
41 double min, double max, double step) { | 41 double min, double max, double step, |
42 mInputDialogContainer.showDialog(dialogType, dialogValue, min, max, step ); | 42 DateTimeSuggestion[] suggestions) { |
43 mInputDialogContainer.showDialog(dialogType, dialogValue, min, max, step , suggestions); | |
43 } | 44 } |
44 | 45 |
45 @CalledByNative | 46 @CalledByNative |
46 private static DateTimeChooserAndroid createDateTimeChooser( | 47 private static DateTimeChooserAndroid createDateTimeChooser( |
47 ContentViewCore contentViewCore, | 48 ContentViewCore contentViewCore, |
48 long nativeDateTimeChooserAndroid, | 49 long nativeDateTimeChooserAndroid, |
49 int dialogType, double dialogValue, | 50 int dialogType, double dialogValue, |
50 double min, double max, double step) { | 51 double min, double max, double step, |
52 DateTimeSuggestion[] suggestions) { | |
51 DateTimeChooserAndroid chooser = | 53 DateTimeChooserAndroid chooser = |
52 new DateTimeChooserAndroid( | 54 new DateTimeChooserAndroid( |
53 contentViewCore.getContext(), | 55 contentViewCore.getContext(), |
54 nativeDateTimeChooserAndroid); | 56 nativeDateTimeChooserAndroid); |
55 chooser.showDialog(dialogType, dialogValue, min, max, step); | 57 chooser.showDialog(dialogType, dialogValue, min, max, step, suggestions) ; |
56 return chooser; | 58 return chooser; |
57 } | 59 } |
58 | 60 |
61 /** | |
62 * @param value Value of the suggestion. | |
63 * @param localizedValue Localized value of the suggestion. | |
64 * @param label Label of the suggestion. | |
65 */ | |
66 @CalledByNative | |
67 private static DateTimeSuggestion createDateTimeSuggestion( | |
bulach
2013/12/03 14:22:29
as above, have two methods:
1) private static Date
keishi
2013/12/03 16:52:34
Done.
| |
68 double value, String localizedValue, String label) { | |
69 return new DateTimeSuggestion(value, localizedValue, label); | |
70 } | |
71 | |
59 @CalledByNative | 72 @CalledByNative |
60 private static void initializeDateInputTypes( | 73 private static void initializeDateInputTypes( |
61 int textInputTypeDate, int textInputTypeDateTime, | 74 int textInputTypeDate, int textInputTypeDateTime, |
62 int textInputTypeDateTimeLocal, int textInputTypeMonth, | 75 int textInputTypeDateTimeLocal, int textInputTypeMonth, |
63 int textInputTypeTime, int textInputTypeWeek) { | 76 int textInputTypeTime, int textInputTypeWeek) { |
64 InputDialogContainer.initializeInputTypes(textInputTypeDate, | 77 InputDialogContainer.initializeInputTypes( |
78 textInputTypeDate, | |
65 textInputTypeDateTime, textInputTypeDateTimeLocal, | 79 textInputTypeDateTime, textInputTypeDateTimeLocal, |
66 textInputTypeMonth, textInputTypeTime, textInputTypeWeek); | 80 textInputTypeMonth, textInputTypeTime, textInputTypeWeek); |
67 } | 81 } |
68 | 82 |
69 private native void nativeReplaceDateTime(long nativeDateTimeChooserAndroid, | 83 private native void nativeReplaceDateTime(long nativeDateTimeChooserAndroid, |
70 double dialogValue); | 84 double dialogValue); |
71 | 85 |
72 private native void nativeCancelDialog(long nativeDateTimeChooserAndroid); | 86 private native void nativeCancelDialog(long nativeDateTimeChooserAndroid); |
73 } | 87 } |
OLD | NEW |