Roll src/third_party/WebKit f298044:aa8346d (svn 202628:202629)
[chromium-blink-merge.git] / content / browser / android / date_time_chooser_android.h
blob6e6c8954b9c04fd23c76bfde18b307cbde12b984
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.
5 #ifndef CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_
6 #define CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_
8 #include <string>
9 #include <vector>
11 #include "base/android/jni_weak_ref.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "ui/base/ime/text_input_type.h"
14 #include "ui/gfx/native_widget_types.h"
16 namespace content {
18 class ContentViewCore;
19 class RenderViewHost;
20 struct DateTimeSuggestion;
22 // Android implementation for DateTimeChooser dialogs.
23 class DateTimeChooserAndroid {
24 public:
25 DateTimeChooserAndroid();
26 ~DateTimeChooserAndroid();
28 // DateTimeChooser implementation:
29 // Shows the dialog. |dialog_value| is the date/time value converted to a
30 // number as defined in HTML. (See blink::InputType::parseToNumber())
31 void ShowDialog(gfx::NativeWindow native_window,
32 RenderViewHost* host,
33 ui::TextInputType dialog_type,
34 double dialog_value,
35 double min,
36 double max,
37 double step,
38 const std::vector<DateTimeSuggestion>& suggestions);
40 // Replaces the current value
41 void ReplaceDateTime(JNIEnv* env, jobject, jdouble value);
43 // Closes the dialog without propagating any changes.
44 void CancelDialog(JNIEnv* env, jobject);
46 private:
47 RenderViewHost* host_;
49 base::android::ScopedJavaGlobalRef<jobject> j_date_time_chooser_;
51 DISALLOW_COPY_AND_ASSIGN(DateTimeChooserAndroid);
54 // Native JNI methods
55 bool RegisterDateTimeChooserAndroid(JNIEnv* env);
57 } // namespace content
59 #endif // CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_