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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java

Issue 639703004: Optimizing DateTimeAndroid and ColorChooserAndroid initializations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the review comments. Created 6 years, 2 months 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java b/content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java
index a673d32a13219a0bfaafd6c10add9bcc6f76fbb2..dc4650f5ec70376581e8ff53ca9a00ad7fccba15 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/DateTimeChooserAndroid.java
@@ -4,11 +4,12 @@
package org.chromium.content.browser.input;
+import android.app.Activity;
import android.content.Context;
import org.chromium.base.CalledByNative;
import org.chromium.base.JNINamespace;
-import org.chromium.content.browser.ContentViewCore;
+import org.chromium.ui.base.WindowAndroid;
import org.chromium.ui.picker.DateTimeSuggestion;
import org.chromium.ui.picker.InputDialogContainer;
@@ -47,15 +48,15 @@ class DateTimeChooserAndroid {
@CalledByNative
private static DateTimeChooserAndroid createDateTimeChooser(
- ContentViewCore contentViewCore,
+ WindowAndroid windowAndroid,
long nativeDateTimeChooserAndroid,
int dialogType, double dialogValue,
double min, double max, double step,
DateTimeSuggestion[] suggestions) {
+ Activity windowAndroidActivity = windowAndroid.getActivity().get();
+ if (windowAndroidActivity == null) return null;
DateTimeChooserAndroid chooser =
- new DateTimeChooserAndroid(
- contentViewCore.getContext(),
- nativeDateTimeChooserAndroid);
+ new DateTimeChooserAndroid(windowAndroidActivity, nativeDateTimeChooserAndroid);
chooser.showDialog(dialogType, dialogValue, min, max, step, suggestions);
return chooser;
}
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698