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 #include "content/browser/android/date_time_chooser_android.h" | 5 #include "content/browser/android/date_time_chooser_android.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "content/common/view_messages.h" | 8 #include "content/common/view_messages.h" |
9 #include "content/public/browser/android/content_view_core.h" | 9 #include "content/public/browser/android/content_view_core.h" |
10 #include "content/public/browser/render_view_host_observer.h" | 10 #include "content/public/browser/render_view_host_observer.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 dialog_type, year, month, day, hour, minute, second); | 82 dialog_type, year, month, day, hour, minute, second); |
83 } | 83 } |
84 | 84 |
85 void DateTimeChooserAndroid::CancelDialog(JNIEnv* env, jobject) { | 85 void DateTimeChooserAndroid::CancelDialog(JNIEnv* env, jobject) { |
86 sender_->CancelDialog(); | 86 sender_->CancelDialog(); |
87 } | 87 } |
88 | 88 |
89 void DateTimeChooserAndroid::ShowDialog( | 89 void DateTimeChooserAndroid::ShowDialog( |
90 ContentViewCore* content, RenderViewHost* sender, | 90 ContentViewCore* content, RenderViewHost* sender, |
91 int type, int year, int month, int day, | 91 int type, int year, int month, int day, |
92 int hour, int minute, int second) { | 92 int hour, int minute, int second, double min, double max) { |
93 if (sender_) | 93 if (sender_) |
94 delete sender_; | 94 delete sender_; |
95 sender_ = new DateTimeIPCSender(sender); | 95 sender_ = new DateTimeIPCSender(sender); |
96 | 96 |
97 JNIEnv* env = AttachCurrentThread(); | 97 JNIEnv* env = AttachCurrentThread(); |
98 j_date_time_chooser_.Reset(Java_DateTimeChooserAndroid_createDateTimeChooser( | 98 j_date_time_chooser_.Reset(Java_DateTimeChooserAndroid_createDateTimeChooser( |
99 env, content->GetJavaObject().obj(), | 99 env, content->GetJavaObject().obj(), |
100 reinterpret_cast<intptr_t>(this), | 100 reinterpret_cast<intptr_t>(this), |
101 type, year, month, day, hour, minute, second)); | 101 type, year, month, day, hour, minute, second, min, max)); |
102 } | 102 } |
103 | 103 |
104 // ---------------------------------------------------------------------------- | 104 // ---------------------------------------------------------------------------- |
105 // Native JNI methods | 105 // Native JNI methods |
106 // ---------------------------------------------------------------------------- | 106 // ---------------------------------------------------------------------------- |
107 bool RegisterDateTimeChooserAndroid(JNIEnv* env) { | 107 bool RegisterDateTimeChooserAndroid(JNIEnv* env) { |
108 bool registered = RegisterNativesImpl(env); | 108 bool registered = RegisterNativesImpl(env); |
109 if (registered) | 109 if (registered) |
110 DateTimeChooserAndroid::InitializeDateInputTypes( | 110 DateTimeChooserAndroid::InitializeDateInputTypes( |
111 ui::TEXT_INPUT_TYPE_DATE, | 111 ui::TEXT_INPUT_TYPE_DATE, |
112 ui::TEXT_INPUT_TYPE_DATE_TIME, | 112 ui::TEXT_INPUT_TYPE_DATE_TIME, |
113 ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL, | 113 ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL, |
114 ui::TEXT_INPUT_TYPE_MONTH, | 114 ui::TEXT_INPUT_TYPE_MONTH, |
115 ui::TEXT_INPUT_TYPE_TIME); | 115 ui::TEXT_INPUT_TYPE_TIME); |
116 return registered; | 116 return registered; |
117 } | 117 } |
118 | 118 |
119 } // namespace content | 119 } // namespace content |
OLD | NEW |