mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 944104 - support creating a GeckoView programmatically r=mfinkle
This commit is contained in:
parent
3333d49ee9
commit
d7c4523357
@ -37,13 +37,21 @@ public class GeckoView extends LayerView
|
||||
private ChromeDelegate mChromeDelegate;
|
||||
private ContentDelegate mContentDelegate;
|
||||
|
||||
public GeckoView(Context context) {
|
||||
super(context);
|
||||
init(context, null, true);
|
||||
}
|
||||
|
||||
public GeckoView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.GeckoView);
|
||||
String url = a.getString(R.styleable.GeckoView_url);
|
||||
boolean doInit = a.getBoolean(R.styleable.GeckoView_doinit, true);
|
||||
a.recycle();
|
||||
init(context, url, doInit);
|
||||
}
|
||||
|
||||
private void init(Context context, String url, boolean doInit) {
|
||||
// TODO: Fennec currently takes care of its own initialization, so this
|
||||
// flag is a hack used in Fennec to prevent GeckoView initialization.
|
||||
// This should go away once Fennec also uses GeckoView for
|
||||
|
@ -119,6 +119,22 @@ public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener
|
||||
Tabs.registerOnTabsChangedListener(this);
|
||||
}
|
||||
|
||||
public LayerView(Context context) {
|
||||
super(context);
|
||||
|
||||
mGLController = GLController.getInstance(this);
|
||||
mPaintState = PAINT_START;
|
||||
mBackgroundColor = Color.WHITE;
|
||||
|
||||
mTouchInterceptors = new ArrayList<TouchEventInterceptor>();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
|
||||
mOverscroll = new OverscrollEdgeEffect(this);
|
||||
} else {
|
||||
mOverscroll = null;
|
||||
}
|
||||
Tabs.registerOnTabsChangedListener(this);
|
||||
}
|
||||
|
||||
public void initializeView(EventDispatcher eventDispatcher) {
|
||||
mLayerClient = new GeckoLayerClient(getContext(), this, eventDispatcher);
|
||||
if (mOverscroll != null) {
|
||||
|
Loading…
Reference in New Issue
Block a user