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 "content/public/browser/date_time_chooser.h" | |
| 9 | |
| 10 #include "base/android/jni_helper.h" | |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 | |
| 13 namespace content { | |
|
bulach
2013/01/10 15:58:35
nit: add a \n
Miguel Garcia
2013/01/11 14:59:37
Done.
| |
| 14 class RenderViewHost; | |
|
bulach
2013/01/10 15:58:35
nit: sort order
Miguel Garcia
2013/01/11 14:59:37
Done.
| |
| 15 class ContentViewCore; | |
| 16 class DateTimeCommunicator; | |
|
bulach
2013/01/10 15:58:35
nit: move this declaration inside the private bloc
Miguel Garcia
2013/01/11 14:59:37
Done.
| |
| 17 | |
| 18 // Glue between renderer and platform specific browser implementations | |
|
bulach
2013/01/10 15:58:35
hmm, this is not really a glue for the renderer, p
Miguel Garcia
2013/01/11 14:59:37
Changed, this makes more sense as an explanation a
| |
| 19 // for date/time based dialogs. | |
| 20 class DateTimeChooserAndroid : public DateTimeChooser { | |
| 21 public: | |
| 22 DateTimeChooserAndroid(); | |
| 23 virtual ~DateTimeChooserAndroid(); | |
| 24 | |
|
bulach
2013/01/10 15:58:35
nit:
// DateTimeChooser implementation:
Miguel Garcia
2013/01/11 14:59:37
Done.
| |
| 25 virtual void ShowDialog(ContentViewCore* content, | |
| 26 RenderViewHost* sender, | |
| 27 int type, const std::string& value) OVERRIDE; | |
| 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 textInputTypeDate, int textInputTypeDateTime, | |
|
bulach
2013/01/10 15:58:35
nit: hacker_style rather than webkitStyle
Miguel Garcia
2013/01/11 14:59:37
Done.
| |
| 39 int textInputTypeDateTimeLocal, int textInputTypeMonth, | |
| 40 int textInputTypeTime); | |
| 41 | |
| 42 private: | |
| 43 scoped_ptr<DateTimeCommunicator> communicator_; | |
| 44 base::android::ScopedJavaGlobalRef<jobject> j_date_time_chooser_; | |
| 45 | |
| 46 DISALLOW_COPY_AND_ASSIGN(DateTimeChooserAndroid); | |
| 47 }; | |
| 48 | |
| 49 // Native JNI methods | |
| 50 bool RegisterDateTimeChooserAndroid(JNIEnv* env); | |
| 51 | |
| 52 } // namespace content | |
| 53 | |
| 54 #endif // CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_ | |
| OLD | NEW |