blob: 6e6c8954b9c04fd23c76bfde18b307cbde12b984 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
// 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 <string>
#include <vector>
#include "base/android/jni_weak_ref.h"
#include "base/memory/scoped_ptr.h"
#include "ui/base/ime/text_input_type.h"
#include "ui/gfx/native_widget_types.h"
namespace content {
class ContentViewCore;
class RenderViewHost;
struct DateTimeSuggestion;
// Android implementation for DateTimeChooser dialogs.
class DateTimeChooserAndroid {
public:
DateTimeChooserAndroid();
~DateTimeChooserAndroid();
// DateTimeChooser implementation:
// Shows the dialog. |dialog_value| is the date/time value converted to a
// number as defined in HTML. (See blink::InputType::parseToNumber())
void ShowDialog(gfx::NativeWindow native_window,
RenderViewHost* host,
ui::TextInputType dialog_type,
double dialog_value,
double min,
double max,
double step,
const std::vector<DateTimeSuggestion>& suggestions);
// Replaces the current value
void ReplaceDateTime(JNIEnv* env, jobject, jdouble value);
// Closes the dialog without propagating any changes.
void CancelDialog(JNIEnv* env, jobject);
private:
RenderViewHost* host_;
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_
|