Closed Bug 944104 Opened 8 years ago Closed 8 years ago

support creating a GeckoView programmatically

Categories

(Firefox for Android Graveyard :: General, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 29

People

(Reporter: blassey, Assigned: blassey)

Details

Attachments

(2 files)

The only constructor for GeckoView takes an AttributeSet argument that isn't null checked.
Assignee: nobody → blassey.bugs
Attachment #8339591 - Flags: review?(mark.finkle)
Comment on attachment 8339591 [details] [diff] [review]
support_programatic.patch

>diff --git a/mobile/android/base/gfx/LayerView.java b/mobile/android/base/gfx/LayerView.java

>+    public LayerView(Context 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);

This is exactly the same as the other LayerView constructor. Let's make a common init() method so both constructors call the single init() method.

r+ but make the init() method
Attachment #8339591 - Flags: review?(mark.finkle) → review+
(In reply to Mark Finkle (:mfinkle) from comment #2)
> Comment on attachment 8339591 [details] [diff] [review]
> support_programatic.patch
> 
> >diff --git a/mobile/android/base/gfx/LayerView.java b/mobile/android/base/gfx/LayerView.java
> 
> >+    public LayerView(Context 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);
> 
> This is exactly the same as the other LayerView constructor. Let's make a
> common init() method so both constructors call the single init() method.
> 
> r+ but make the init() method

you can't have an init() method because the member variables are final.
https://hg.mozilla.org/mozilla-central/rev/92d8dc924a05
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 29
Attachment #8346297 - Flags: review?(mark.finkle)
Attachment #8346297 - Flags: review?(mark.finkle) → review+
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.