Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_ | |
| 6 #define CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/android/jni_helper.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 | |
| 13 namespace content { | |
| 14 | |
| 15 class ContentViewCore; | |
| 16 class RenderViewHost; | |
| 17 | |
| 18 // Android implementation for DateTimeChooser dialogs. | |
| 19 class DateTimeChooserAndroid { | |
| 20 public: | |
| 21 DateTimeChooserAndroid(); | |
| 22 virtual ~DateTimeChooserAndroid(); | |
|
bulach
2013/01/17 10:32:21
no need for virtual since it's a concrete, final c
Miguel Garcia
2013/01/17 12:17:40
Done.
| |
| 23 | |
| 24 // DateTimeChooser implementation: | |
| 25 void ShowDialog(ContentViewCore* content, | |
| 26 RenderViewHost* sender, | |
| 27 int type, const std::string& value); | |
| 28 | |
| 29 // Replaces the current value with the one passed in text. | |
| 30 void ReplaceDateTime(JNIEnv* env, jobject, jstring text); | |
| 31 | |
| 32 // Closes the dialog without propagating any changes. | |
| 33 void CancelDialog(JNIEnv* env, jobject); | |
| 34 | |
| 35 // Propagates the different types of accepted date/time values to the | |
| 36 // java side. | |
| 37 static void InitializeDateInputTypes( | |
| 38 int text_input_type_date, int text_input_type_date_time, | |
| 39 int text_input_type_date_time_local, int text_input_type_month, | |
| 40 int text_input_type_time); | |
| 41 | |
| 42 private: | |
| 43 class DateTimeIPCSender; | |
| 44 | |
| 45 scoped_ptr<DateTimeIPCSender> communicator_; | |
| 46 base::android::ScopedJavaGlobalRef<jobject> j_date_time_chooser_; | |
| 47 | |
| 48 DISALLOW_COPY_AND_ASSIGN(DateTimeChooserAndroid); | |
| 49 }; | |
| 50 | |
| 51 // Native JNI methods | |
| 52 bool RegisterDateTimeChooserAndroid(JNIEnv* env); | |
| 53 | |
| 54 } // namespace content | |
| 55 | |
| 56 #endif // CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_ | |
| OLD | NEW |