Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1326)

Unified Diff: ui/android/java/src/org/chromium/ui/picker/ChromeDatePickerDialog.java

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/android/java/src/org/chromium/ui/picker/ChromeDatePickerDialog.java
diff --git a/ui/android/java/src/org/chromium/ui/picker/ChromeDatePickerDialog.java b/ui/android/java/src/org/chromium/ui/picker/ChromeDatePickerDialog.java
deleted file mode 100644
index e3c1e27d13313af27df94b375848bca8043da44f..0000000000000000000000000000000000000000
--- a/ui/android/java/src/org/chromium/ui/picker/ChromeDatePickerDialog.java
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2014 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.
-
-package org.chromium.ui.picker;
-
-import android.app.DatePickerDialog;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.os.Build;
-import android.widget.DatePicker;
-
-/**
- * The behavior of the DatePickerDialog changed after JellyBean so it now calls
- * OndateSetListener.onDateSet() even when the dialog is dismissed (e.g. back button, tap
- * outside). This class will call the listener instead of the DatePickerDialog only when the
- * BUTTON_POSITIVE has been clicked.
- */
-class ChromeDatePickerDialog extends DatePickerDialog {
- private final OnDateSetListener mCallBack;
-
- public ChromeDatePickerDialog(Context context,
- OnDateSetListener callBack,
- int year,
- int monthOfYear,
- int dayOfMonth) {
- super(context, callBack, year, monthOfYear, dayOfMonth);
-
- mCallBack = callBack;
- }
-
- /**
- * The superclass DatePickerDialog has null for OnDateSetListener so we need to call the
- * listener manually.
- */
- @Override
- public void onClick(DialogInterface dialog, int which) {
- if (which == BUTTON_POSITIVE && mCallBack != null) {
- DatePicker datePicker = getDatePicker();
- datePicker.clearFocus();
- mCallBack.onDateSet(datePicker, datePicker.getYear(),
- datePicker.getMonth(), datePicker.getDayOfMonth());
- }
- }
-
- @Override
- public void setTitle(CharSequence title) {
- // On Android L+, the dialog shouldn't have a title. This works around a bug in
- // DatePickerDialog where calling updateDate() before the dialog has been shown causes
- // a title to appear. http://crbug.com/541350
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- title = "";
- }
- super.setTitle(title);
- }
-}

Powered by Google App Engine
This is Rietveld 408576698