diff options
author | aurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-19 08:38:12 +0000 |
---|---|---|
committer | aurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-19 08:38:12 +0000 |
commit | f2c9f3fc6714915444f9d55f18f4b4f7e0b52bac (patch) | |
tree | 30b84c6577b91fd31deaef5f15a808542ac40941 /chrome/android/java | |
parent | ad81ae41a88cd603c260e5aa6ec7b24a60d650ea (diff) | |
download | chromium_src-f2c9f3fc6714915444f9d55f18f4b4f7e0b52bac.zip chromium_src-f2c9f3fc6714915444f9d55f18f4b4f7e0b52bac.tar.gz chromium_src-f2c9f3fc6714915444f9d55f18f4b4f7e0b52bac.tar.bz2 |
[Android] Rename NativeWindow to WindowAndroid.
Renaming NativeWindow to WindowAndroid for consistency with C++ name of window_android.
Also removing AwNativeWindow as according to joth@ it is no longer isued in WebView.
BUG=233064
Review URL: https://chromiumcodereview.appspot.com/14169011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/android/java')
5 files changed, 26 insertions, 29 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/JavascriptAppModalDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/JavascriptAppModalDialog.java index 7d064ab..171e5d8 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/JavascriptAppModalDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/JavascriptAppModalDialog.java @@ -20,7 +20,7 @@ import com.google.common.annotations.VisibleForTesting; import org.chromium.base.CalledByNative; import org.chromium.chrome.R; -import org.chromium.ui.gfx.NativeWindow; +import org.chromium.ui.WindowAndroid; public class JavascriptAppModalDialog implements DialogInterface.OnClickListener { private static final String TAG = JavascriptAppModalDialog.class.getName(); @@ -67,7 +67,7 @@ public class JavascriptAppModalDialog implements DialogInterface.OnClickListener } @CalledByNative - void showJavascriptAppModalDialog(NativeWindow window, int nativeDialogPointer) { + void showJavascriptAppModalDialog(WindowAndroid window, int nativeDialogPointer) { assert window != null; Context context = window.getContext(); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java b/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java index 891d11f..972af11 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/TabBase.java @@ -6,7 +6,7 @@ package org.chromium.chrome.browser; import org.chromium.base.CalledByNative; import org.chromium.content.browser.ContentView; -import org.chromium.ui.gfx.NativeWindow; +import org.chromium.ui.WindowAndroid; /** * The basic Java representation of a tab. Contains and manages a {@link ContentView}. @@ -20,11 +20,11 @@ import org.chromium.ui.gfx.NativeWindow; * parent classes. */ public abstract class TabBase { - private final NativeWindow mNativeWindow; + private final WindowAndroid mWindowAndroid; private int mNativeTabAndroid; - protected TabBase(NativeWindow window) { - mNativeWindow = window; + protected TabBase(WindowAndroid window) { + mWindowAndroid = window; } @CalledByNative @@ -39,7 +39,7 @@ public abstract class TabBase { mNativeTabAndroid = nativePtr; } - protected NativeWindow getNativeWindow() { - return mNativeWindow; + protected WindowAndroid getWindowAndroid() { + return mWindowAndroid; } } diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogGlue.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogGlue.java index 3a65d7b..7423e3f 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogGlue.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialogGlue.java @@ -9,7 +9,7 @@ import android.graphics.Bitmap; import org.chromium.base.CalledByNative; import org.chromium.base.JNINamespace; import org.chromium.chrome.browser.autofill.AutofillDialog.AutofillDialogDelegate; -import org.chromium.ui.gfx.NativeWindow; +import org.chromium.ui.WindowAndroid; /** * JNI call glue for AutofillDialog C++ and Java objects. @@ -22,7 +22,7 @@ public class AutofillDialogGlue implements AutofillDialogDelegate, private final AutofillDialog mAutofillDialog; private final AutofillDialogAccountHelper mAccountHelper; - public AutofillDialogGlue(int nativeAutofillDialogViewAndroid, NativeWindow nativeWindow, + public AutofillDialogGlue(int nativeAutofillDialogViewAndroid, WindowAndroid nativeWindow, String useBillingForShippingText, String saveLocallyText) { mNativeDialogPopup = nativeAutofillDialogViewAndroid; mAccountHelper = new AutofillDialogAccountHelper(this, nativeWindow.getContext()); @@ -34,7 +34,7 @@ public class AutofillDialogGlue implements AutofillDialogDelegate, @CalledByNative private static AutofillDialogGlue create(int nativeAutofillDialogViewAndroid, - NativeWindow nativeWindow, + WindowAndroid nativeWindow, String useBillingForShippingText, String saveLocallyText) { return new AutofillDialogGlue(nativeAutofillDialogViewAndroid, nativeWindow, useBillingForShippingText, saveLocallyText); diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java index 0a256fb..b5cd39b 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopup.java @@ -10,13 +10,11 @@ import android.graphics.Paint; import android.graphics.Point; import android.graphics.Rect; import android.graphics.drawable.Drawable; -import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; import android.widget.AdapterView; import android.widget.FrameLayout; -import android.widget.ListAdapter; import android.widget.ListPopupWindow; import android.widget.TextView; @@ -25,7 +23,7 @@ import java.util.ArrayList; import org.chromium.chrome.R; import org.chromium.content.browser.ContainerViewDelegate; import org.chromium.ui.gfx.DeviceDisplayInfo; -import org.chromium.ui.gfx.NativeWindow; +import org.chromium.ui.WindowAndroid; /** * The Autofill suggestion popup that lists relevant suggestions. @@ -46,7 +44,7 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem private static final int TEXT_PADDING_DP = 30; private final AutofillPopupDelegate mAutofillCallback; - private final NativeWindow mNativeWindow; + private final Context mContext; private final ContainerViewDelegate mContainerViewDelegate; private AnchorView mAnchorView; private Rect mAnchorRect; @@ -124,20 +122,20 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem /** * Creates an AutofillWindow with specified parameters. - * @param nativeWindow NativeWindow used to get application context. + * @param context Application context. * @param containerViewDelegate View delegate used to add and remove views. * @param autofillCallback A object that handles the calls to the native AutofillPopupView. */ - public AutofillPopup(NativeWindow nativeWindow, ContainerViewDelegate containerViewDelegate, + public AutofillPopup(Context context, ContainerViewDelegate containerViewDelegate, AutofillPopupDelegate autofillCallback) { - super(nativeWindow.getContext()); - mNativeWindow = nativeWindow; + super(context); + mContext = context; mContainerViewDelegate = containerViewDelegate; mAutofillCallback = autofillCallback; setOnItemClickListener(this); - mAnchorView = new AnchorView(mNativeWindow.getContext(), this); + mAnchorView = new AnchorView(context, this); mContainerViewDelegate.addViewToContainerView(mAnchorView); setAnchorView(mAnchorView); } @@ -151,7 +149,7 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem * @param height The height of the anchor view. */ public void setAnchorRect(float x, float y, float width, float height) { - float scale = (float) DeviceDisplayInfo.create(mNativeWindow.getContext()).getDIPScale(); + float scale = (float) DeviceDisplayInfo.create(mContext).getDIPScale(); mAnchorRect = new Rect(Math.round(x * scale), Math.round(y * scale), Math.round((x + width) * scale), Math.round((y + height) * scale)); mAnchorRect.offset(0, mContainerViewDelegate.getChildViewOffsetYPix()); @@ -171,7 +169,7 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem cleanedData.add(suggestions[i]); } } - setAdapter(new AutofillListAdapter(mNativeWindow.getContext(), cleanedData)); + setAdapter(new AutofillListAdapter(mContext, cleanedData)); // Once the mAnchorRect is resized and placed correctly, it will show the Autofill popup. mAnchorView.setSize(mAnchorRect, getDesiredWidth(suggestions)); } @@ -201,8 +199,7 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem private int getDesiredWidth(AutofillSuggestion[] data) { if (mNameViewPaint == null || mLabelViewPaint == null) { LayoutInflater inflater = - (LayoutInflater) mNativeWindow.getContext().getSystemService( - Context.LAYOUT_INFLATER_SERVICE); + (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.autofill_text, null); TextView nameView = (TextView) layout.findViewById(R.id.autofill_name); mNameViewPaint = nameView.getPaint(); @@ -227,7 +224,7 @@ public class AutofillPopup extends ListPopupWindow implements AdapterView.OnItem } // Adding padding. return maxTextWidth + (int) (TEXT_PADDING_DP * - mNativeWindow.getContext().getResources().getDisplayMetrics().density); + mContext.getResources().getDisplayMetrics().density); } @Override diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupGlue.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupGlue.java index 34dca60..d5c7af0 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupGlue.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillPopupGlue.java @@ -8,7 +8,7 @@ import org.chromium.base.CalledByNative; import org.chromium.base.JNINamespace; import org.chromium.chrome.browser.autofill.AutofillPopup.AutofillPopupDelegate; import org.chromium.content.browser.ContainerViewDelegate; -import org.chromium.ui.gfx.NativeWindow; +import org.chromium.ui.WindowAndroid; /** * JNI call glue for AutofillExternalDelagate C++ and Java objects. @@ -18,15 +18,15 @@ public class AutofillPopupGlue implements AutofillPopupDelegate{ private final int mNativeAutofillPopup; private final AutofillPopup mAutofillPopup; - public AutofillPopupGlue(int nativeAutofillPopupViewAndroid, NativeWindow nativeWindow, + public AutofillPopupGlue(int nativeAutofillPopupViewAndroid, WindowAndroid nativeWindow, ContainerViewDelegate containerViewDelegate) { mNativeAutofillPopup = nativeAutofillPopupViewAndroid; - mAutofillPopup = new AutofillPopup(nativeWindow, containerViewDelegate, this); + mAutofillPopup = new AutofillPopup(nativeWindow.getContext(), containerViewDelegate, this); } @CalledByNative private static AutofillPopupGlue create(int nativeAutofillPopupViewAndroid, - NativeWindow nativeWindow, ContainerViewDelegate containerViewDelegate) { + WindowAndroid nativeWindow, ContainerViewDelegate containerViewDelegate) { return new AutofillPopupGlue(nativeAutofillPopupViewAndroid, nativeWindow, containerViewDelegate); } |