blob: 6e6c8954b9c04fd23c76bfde18b307cbde12b984 [file] [log] [blame]
[email protected]583418cc2013-01-17 14:01:101// 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>
[email protected]6e08bfb2013-12-07 02:56:179#include <vector>
[email protected]583418cc2013-01-17 14:01:1010
[email protected]6a718ab2014-04-23 20:01:2011#include "base/android/jni_weak_ref.h"
[email protected]583418cc2013-01-17 14:01:1012#include "base/memory/scoped_ptr.h"
[email protected]e8072562013-12-04 06:04:1313#include "ui/base/ime/text_input_type.h"
ajith.v9e47ab52014-10-30 20:24:1714#include "ui/gfx/native_widget_types.h"
[email protected]583418cc2013-01-17 14:01:1015
16namespace content {
17
18class ContentViewCore;
19class RenderViewHost;
[email protected]6e08bfb2013-12-07 02:56:1720struct DateTimeSuggestion;
[email protected]583418cc2013-01-17 14:01:1021
22// Android implementation for DateTimeChooser dialogs.
23class DateTimeChooserAndroid {
24 public:
25 DateTimeChooserAndroid();
26 ~DateTimeChooserAndroid();
27
28 // DateTimeChooser implementation:
[email protected]e8072562013-12-04 06:04:1329 // Shows the dialog. |dialog_value| is the date/time value converted to a
30 // number as defined in HTML. (See blink::InputType::parseToNumber())
ajith.v9e47ab52014-10-30 20:24:1731 void ShowDialog(gfx::NativeWindow native_window,
[email protected]4e7f4312013-10-24 00:46:0632 RenderViewHost* host,
[email protected]e8072562013-12-04 06:04:1333 ui::TextInputType dialog_type,
34 double dialog_value,
[email protected]ee59cbec2013-08-16 14:59:0935 double min,
36 double max,
[email protected]6e08bfb2013-12-07 02:56:1737 double step,
38 const std::vector<DateTimeSuggestion>& suggestions);
[email protected]583418cc2013-01-17 14:01:1039
[email protected]e8072562013-12-04 06:04:1340 // Replaces the current value
41 void ReplaceDateTime(JNIEnv* env, jobject, jdouble value);
[email protected]583418cc2013-01-17 14:01:1042
43 // Closes the dialog without propagating any changes.
44 void CancelDialog(JNIEnv* env, jobject);
45
[email protected]583418cc2013-01-17 14:01:1046 private:
[email protected]4e7f4312013-10-24 00:46:0647 RenderViewHost* host_;
[email protected]2ed7c4992013-04-25 18:25:4448
[email protected]583418cc2013-01-17 14:01:1049 base::android::ScopedJavaGlobalRef<jobject> j_date_time_chooser_;
50
51 DISALLOW_COPY_AND_ASSIGN(DateTimeChooserAndroid);
52};
53
54// Native JNI methods
55bool RegisterDateTimeChooserAndroid(JNIEnv* env);
56
57} // namespace content
58
59#endif // CONTENT_BROWSER_ANDROID_DATE_TIME_CHOOSER_ANDROID_H_