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

Unified Diff: components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/ColorChooserAndroid.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 | « no previous file | components/web_contents_delegate_android/color_chooser_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/ColorChooserAndroid.java
diff --git a/components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/ColorChooserAndroid.java b/components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/ColorChooserAndroid.java
index c1fe69ce5e34d825de024a89eb11ec16d4227841..e0041a370d32de4177bf4a566d6536c683cf01f5 100644
--- a/components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/ColorChooserAndroid.java
+++ b/components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/ColorChooserAndroid.java
@@ -4,14 +4,15 @@
package org.chromium.components.web_contents_delegate_android;
+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.ColorPickerDialog;
import org.chromium.ui.ColorSuggestion;
import org.chromium.ui.OnColorChangedListener;
+import org.chromium.ui.base.WindowAndroid;
/**
* ColorChooserAndroid communicates with the java ColorPickerDialog and the
@@ -48,11 +49,13 @@ public class ColorChooserAndroid {
@CalledByNative
public static ColorChooserAndroid createColorChooserAndroid(
long nativeColorChooserAndroid,
- ContentViewCore contentViewCore,
+ WindowAndroid windowAndroid,
int initialColor,
ColorSuggestion[] suggestions) {
+ Activity windowAndroidActivity = windowAndroid.getActivity().get();
+ if (windowAndroidActivity == null) return null;
ColorChooserAndroid chooser = new ColorChooserAndroid(nativeColorChooserAndroid,
- contentViewCore.getContext(), initialColor, suggestions);
+ windowAndroidActivity, initialColor, suggestions);
chooser.openColorChooser();
return chooser;
}
« no previous file with comments | « no previous file | components/web_contents_delegate_android/color_chooser_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698