Chromium Code Reviews| Index: content/browser/android/date_time_chooser_android.h |
| diff --git a/content/browser/android/date_time_chooser_android.h b/content/browser/android/date_time_chooser_android.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d09935c0500f0a8ed8d48b401d0364e83d1e437a |
| --- /dev/null |
| +++ b/content/browser/android/date_time_chooser_android.h |
| @@ -0,0 +1,54 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_ |
| +#define CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_ |
| + |
| +#include "content/public/browser/date_time_chooser.h" |
| + |
| +#include "base/android/jni_helper.h" |
| +#include "base/memory/scoped_ptr.h" |
| + |
| +namespace content { |
|
bulach
2013/01/10 15:58:35
nit: add a \n
Miguel Garcia
2013/01/11 14:59:37
Done.
|
| +class RenderViewHost; |
|
bulach
2013/01/10 15:58:35
nit: sort order
Miguel Garcia
2013/01/11 14:59:37
Done.
|
| +class ContentViewCore; |
| +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.
|
| + |
| +// 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
|
| +// for date/time based dialogs. |
| +class DateTimeChooserAndroid : public DateTimeChooser { |
| + public: |
| + DateTimeChooserAndroid(); |
| + virtual ~DateTimeChooserAndroid(); |
| + |
|
bulach
2013/01/10 15:58:35
nit:
// DateTimeChooser implementation:
Miguel Garcia
2013/01/11 14:59:37
Done.
|
| + virtual void ShowDialog(ContentViewCore* content, |
| + RenderViewHost* sender, |
| + int type, const std::string& value) OVERRIDE; |
| + |
| + // Replaces the current value with the one passed in text. |
| + void ReplaceDateTime(JNIEnv* env, jobject, jstring text); |
| + |
| + // Closes the dialog without propagating any changes. |
| + void CancelDialog(JNIEnv* env, jobject); |
| + |
| + // Propagates the different types of accepted date/time values to the |
| + // java side. |
| + static void InitializeDateInputTypes( |
| + 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.
|
| + int textInputTypeDateTimeLocal, int textInputTypeMonth, |
| + int textInputTypeTime); |
| + |
| + private: |
| + scoped_ptr<DateTimeCommunicator> communicator_; |
| + base::android::ScopedJavaGlobalRef<jobject> j_date_time_chooser_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DateTimeChooserAndroid); |
| +}; |
| + |
| +// Native JNI methods |
| +bool RegisterDateTimeChooserAndroid(JNIEnv* env); |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_ |