Backed out changeset 4bcc69eb4a27 (bug 1102339) for stumbler-related robocop failures
authorWes Kocher <wkocher@mozilla.com>
Fri, 21 Nov 2014 15:54:49 -0800
changeset 241395 742159b11c69d812a6411de91d054dd38063f0da
parent 241394 23410bbf21619cea251cd9123cfef4e4db012cd3
child 241396 8525554ff2ecc9c4c1ac7febd6c97a272901e952
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1102339
milestone36.0a1
backs out4bcc69eb4a27db09b2423c52c22a0c07baffd7d0
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 4bcc69eb4a27 (bug 1102339) for stumbler-related robocop failures
mobile/android/base/moz.build
mobile/android/base/widget/ThemedEditText.java
mobile/android/base/widget/ThemedEditText.java.in
mobile/android/base/widget/ThemedImageButton.java
mobile/android/base/widget/ThemedImageButton.java.in
mobile/android/base/widget/ThemedImageView.java
mobile/android/base/widget/ThemedImageView.java.in
mobile/android/base/widget/ThemedLinearLayout.java
mobile/android/base/widget/ThemedLinearLayout.java.in
mobile/android/base/widget/ThemedRelativeLayout.java
mobile/android/base/widget/ThemedRelativeLayout.java.in
mobile/android/base/widget/ThemedTextSwitcher.java
mobile/android/base/widget/ThemedTextSwitcher.java.in
mobile/android/base/widget/ThemedTextView.java
mobile/android/base/widget/ThemedTextView.java.in
mobile/android/base/widget/ThemedView.java
mobile/android/base/widget/ThemedView.java.frag
mobile/android/base/widget/ThemedView.java.in
mobile/android/base/widget/generate_themed_views.py
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -473,37 +473,32 @@ gbjar.sources += [
     'widget/ResizablePathDrawable.java',
     'widget/SquaredImageView.java',
     'widget/SwipeDismissListViewTouchListener.java',
     'widget/TabThumbnailWrapper.java',
     'widget/ThumbnailView.java',
     'widget/TwoWayView.java',
     'ZoomConstraints.java',
 ]
-# The following sources are checked in to version control but
-# generated by a script (widget/generate_themed_views.py).  If you're
-# editing this list, make sure to edit that script.
-gbjar.sources += [
-    'widget/ThemedEditText.java',
-    'widget/ThemedImageButton.java',
-    'widget/ThemedImageView.java',
-    'widget/ThemedLinearLayout.java',
-    'widget/ThemedRelativeLayout.java',
-    'widget/ThemedTextSwitcher.java',
-    'widget/ThemedTextView.java',
-    'widget/ThemedView.java',
-]
 gbjar.sources += [ thirdparty_source_dir + f for f in [
     'com/googlecode/eyesfree/braille/selfbraille/ISelfBrailleService.java',
     'com/googlecode/eyesfree/braille/selfbraille/SelfBrailleClient.java',
     'com/googlecode/eyesfree/braille/selfbraille/WriteData.java',
 ] ]
 android_package_dir = CONFIG['ANDROID_PACKAGE_NAME'].replace('.', '/')
 gbjar.generated_sources += [
     'org/mozilla/gecko/SysInfo.java',
+    'org/mozilla/gecko/widget/ThemedEditText.java',
+    'org/mozilla/gecko/widget/ThemedImageButton.java',
+    'org/mozilla/gecko/widget/ThemedImageView.java',
+    'org/mozilla/gecko/widget/ThemedLinearLayout.java',
+    'org/mozilla/gecko/widget/ThemedRelativeLayout.java',
+    'org/mozilla/gecko/widget/ThemedTextSwitcher.java',
+    'org/mozilla/gecko/widget/ThemedTextView.java',
+    'org/mozilla/gecko/widget/ThemedView.java',
 ]
 if CONFIG['MOZ_CRASHREPORTER']:
     gbjar.sources += [ 'CrashReporter.java' ]
     ANDROID_RES_DIRS += [ SRCDIR + '/crashreporter/res' ]
 
 if CONFIG['MOZ_ANDROID_SHARE_OVERLAY']:
     gbjar.sources += [
         'overlays/OverlayConstants.java',
deleted file mode 100644
--- a/mobile/android/base/widget/ThemedEditText.java
+++ /dev/null
@@ -1,155 +0,0 @@
-// This file is generated by generate_themed_views.py; do not edit.
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.widget;
-
-import org.mozilla.gecko.GeckoApplication;
-import org.mozilla.gecko.LightweightTheme;
-import org.mozilla.gecko.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.drawable.ColorDrawable;
-import android.util.AttributeSet;
-
-public class ThemedEditText extends android.widget.EditText
-                                     implements LightweightTheme.OnChangeListener {
-    private LightweightTheme mTheme;
-
-    private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
-    private static final int[] STATE_LIGHT = { R.attr.state_light };
-    private static final int[] STATE_DARK = { R.attr.state_dark };
-
-    protected static final int[] PRIVATE_PRESSED_STATE_SET = { R.attr.state_private, android.R.attr.state_pressed };
-    protected static final int[] PRIVATE_FOCUSED_STATE_SET = { R.attr.state_private, android.R.attr.state_focused };
-    protected static final int[] PRIVATE_STATE_SET = { R.attr.state_private };
-
-    private boolean mIsPrivate;
-    private boolean mIsLight;
-    private boolean mIsDark;
-    private boolean mAutoUpdateTheme;        // always false if there's no theme.
-
-    public ThemedEditText(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initialize(context, attrs);
-    }
-
-    public ThemedEditText(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        initialize(context, attrs);
-    }
-
-    private void initialize(final Context context, final AttributeSet attrs) {
-        // The theme can be null, particularly for webapps: Bug 1089266.
-        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
-
-        final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
-        mAutoUpdateTheme = mTheme != null && a.getBoolean(R.styleable.LightweightTheme_autoUpdateTheme, true);
-        a.recycle();
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.addListener(this);
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.removeListener(this);
-    }
-
-    @Override
-    public int[] onCreateDrawableState(int extraSpace) {
-        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
-
-        if (mIsPrivate)
-            mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
-        else if (mIsLight)
-            mergeDrawableStates(drawableState, STATE_LIGHT);
-        else if (mIsDark)
-            mergeDrawableStates(drawableState, STATE_DARK);
-
-        return drawableState;
-    }
-
-    @Override
-    public void onLightweightThemeChanged() {
-        if (mAutoUpdateTheme && mTheme.isEnabled())
-            setTheme(mTheme.isLightTheme());
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        if (mAutoUpdateTheme)
-            resetTheme();
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        super.onLayout(changed, left, top, right, bottom);
-        onLightweightThemeChanged();
-    }
-
-    public boolean isPrivateMode() {
-        return mIsPrivate;
-    }
-
-    public void setPrivateMode(boolean isPrivate) {
-        if (mIsPrivate != isPrivate) {
-            mIsPrivate = isPrivate;
-            refreshDrawableState();
-        }
-    }
-
-    public void setTheme(boolean isLight) {
-        // Set the theme only if it is different from existing theme.
-        if ((isLight && mIsLight != isLight) ||
-            (!isLight && mIsDark == isLight)) {
-            if (isLight) {
-                mIsLight = true;
-                mIsDark = false;
-            } else {
-                mIsLight = false;
-                mIsDark = true;
-            }
-
-            refreshDrawableState();
-        }
-    }
-
-    public void resetTheme() {
-        if (mIsLight || mIsDark) {
-            mIsLight = false;
-            mIsDark = false;
-            refreshDrawableState();
-        }
-    }
-
-    public void setAutoUpdateTheme(boolean autoUpdateTheme) {
-        if (mTheme == null) {
-            return;
-        }
-
-        if (mAutoUpdateTheme != autoUpdateTheme) {
-            mAutoUpdateTheme = autoUpdateTheme;
-
-            if (mAutoUpdateTheme)
-                mTheme.addListener(this);
-            else
-                mTheme.removeListener(this);
-        }
-    }
-
-    public ColorDrawable getColorDrawable(int id) {
-        return new ColorDrawable(getResources().getColor(id));
-    }
-}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/widget/ThemedEditText.java.in
@@ -0,0 +1,5 @@
+//#filter substitution
+//#define VIEW_NAME_SUFFIX EditText
+//#define BASE_TYPE android.widget.EditText
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
deleted file mode 100644
--- a/mobile/android/base/widget/ThemedImageButton.java
+++ /dev/null
@@ -1,155 +0,0 @@
-// This file is generated by generate_themed_views.py; do not edit.
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.widget;
-
-import org.mozilla.gecko.GeckoApplication;
-import org.mozilla.gecko.LightweightTheme;
-import org.mozilla.gecko.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.drawable.ColorDrawable;
-import android.util.AttributeSet;
-
-public class ThemedImageButton extends android.widget.ImageButton
-                                     implements LightweightTheme.OnChangeListener {
-    private LightweightTheme mTheme;
-
-    private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
-    private static final int[] STATE_LIGHT = { R.attr.state_light };
-    private static final int[] STATE_DARK = { R.attr.state_dark };
-
-    protected static final int[] PRIVATE_PRESSED_STATE_SET = { R.attr.state_private, android.R.attr.state_pressed };
-    protected static final int[] PRIVATE_FOCUSED_STATE_SET = { R.attr.state_private, android.R.attr.state_focused };
-    protected static final int[] PRIVATE_STATE_SET = { R.attr.state_private };
-
-    private boolean mIsPrivate;
-    private boolean mIsLight;
-    private boolean mIsDark;
-    private boolean mAutoUpdateTheme;        // always false if there's no theme.
-
-    public ThemedImageButton(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initialize(context, attrs);
-    }
-
-    public ThemedImageButton(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        initialize(context, attrs);
-    }
-
-    private void initialize(final Context context, final AttributeSet attrs) {
-        // The theme can be null, particularly for webapps: Bug 1089266.
-        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
-
-        final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
-        mAutoUpdateTheme = mTheme != null && a.getBoolean(R.styleable.LightweightTheme_autoUpdateTheme, true);
-        a.recycle();
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.addListener(this);
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.removeListener(this);
-    }
-
-    @Override
-    public int[] onCreateDrawableState(int extraSpace) {
-        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
-
-        if (mIsPrivate)
-            mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
-        else if (mIsLight)
-            mergeDrawableStates(drawableState, STATE_LIGHT);
-        else if (mIsDark)
-            mergeDrawableStates(drawableState, STATE_DARK);
-
-        return drawableState;
-    }
-
-    @Override
-    public void onLightweightThemeChanged() {
-        if (mAutoUpdateTheme && mTheme.isEnabled())
-            setTheme(mTheme.isLightTheme());
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        if (mAutoUpdateTheme)
-            resetTheme();
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        super.onLayout(changed, left, top, right, bottom);
-        onLightweightThemeChanged();
-    }
-
-    public boolean isPrivateMode() {
-        return mIsPrivate;
-    }
-
-    public void setPrivateMode(boolean isPrivate) {
-        if (mIsPrivate != isPrivate) {
-            mIsPrivate = isPrivate;
-            refreshDrawableState();
-        }
-    }
-
-    public void setTheme(boolean isLight) {
-        // Set the theme only if it is different from existing theme.
-        if ((isLight && mIsLight != isLight) ||
-            (!isLight && mIsDark == isLight)) {
-            if (isLight) {
-                mIsLight = true;
-                mIsDark = false;
-            } else {
-                mIsLight = false;
-                mIsDark = true;
-            }
-
-            refreshDrawableState();
-        }
-    }
-
-    public void resetTheme() {
-        if (mIsLight || mIsDark) {
-            mIsLight = false;
-            mIsDark = false;
-            refreshDrawableState();
-        }
-    }
-
-    public void setAutoUpdateTheme(boolean autoUpdateTheme) {
-        if (mTheme == null) {
-            return;
-        }
-
-        if (mAutoUpdateTheme != autoUpdateTheme) {
-            mAutoUpdateTheme = autoUpdateTheme;
-
-            if (mAutoUpdateTheme)
-                mTheme.addListener(this);
-            else
-                mTheme.removeListener(this);
-        }
-    }
-
-    public ColorDrawable getColorDrawable(int id) {
-        return new ColorDrawable(getResources().getColor(id));
-    }
-}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/widget/ThemedImageButton.java.in
@@ -0,0 +1,5 @@
+//#filter substitution
+//#define VIEW_NAME_SUFFIX ImageButton
+//#define BASE_TYPE android.widget.ImageButton
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
deleted file mode 100644
--- a/mobile/android/base/widget/ThemedImageView.java
+++ /dev/null
@@ -1,155 +0,0 @@
-// This file is generated by generate_themed_views.py; do not edit.
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.widget;
-
-import org.mozilla.gecko.GeckoApplication;
-import org.mozilla.gecko.LightweightTheme;
-import org.mozilla.gecko.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.drawable.ColorDrawable;
-import android.util.AttributeSet;
-
-public class ThemedImageView extends android.widget.ImageView
-                                     implements LightweightTheme.OnChangeListener {
-    private LightweightTheme mTheme;
-
-    private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
-    private static final int[] STATE_LIGHT = { R.attr.state_light };
-    private static final int[] STATE_DARK = { R.attr.state_dark };
-
-    protected static final int[] PRIVATE_PRESSED_STATE_SET = { R.attr.state_private, android.R.attr.state_pressed };
-    protected static final int[] PRIVATE_FOCUSED_STATE_SET = { R.attr.state_private, android.R.attr.state_focused };
-    protected static final int[] PRIVATE_STATE_SET = { R.attr.state_private };
-
-    private boolean mIsPrivate;
-    private boolean mIsLight;
-    private boolean mIsDark;
-    private boolean mAutoUpdateTheme;        // always false if there's no theme.
-
-    public ThemedImageView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initialize(context, attrs);
-    }
-
-    public ThemedImageView(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        initialize(context, attrs);
-    }
-
-    private void initialize(final Context context, final AttributeSet attrs) {
-        // The theme can be null, particularly for webapps: Bug 1089266.
-        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
-
-        final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
-        mAutoUpdateTheme = mTheme != null && a.getBoolean(R.styleable.LightweightTheme_autoUpdateTheme, true);
-        a.recycle();
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.addListener(this);
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.removeListener(this);
-    }
-
-    @Override
-    public int[] onCreateDrawableState(int extraSpace) {
-        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
-
-        if (mIsPrivate)
-            mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
-        else if (mIsLight)
-            mergeDrawableStates(drawableState, STATE_LIGHT);
-        else if (mIsDark)
-            mergeDrawableStates(drawableState, STATE_DARK);
-
-        return drawableState;
-    }
-
-    @Override
-    public void onLightweightThemeChanged() {
-        if (mAutoUpdateTheme && mTheme.isEnabled())
-            setTheme(mTheme.isLightTheme());
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        if (mAutoUpdateTheme)
-            resetTheme();
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        super.onLayout(changed, left, top, right, bottom);
-        onLightweightThemeChanged();
-    }
-
-    public boolean isPrivateMode() {
-        return mIsPrivate;
-    }
-
-    public void setPrivateMode(boolean isPrivate) {
-        if (mIsPrivate != isPrivate) {
-            mIsPrivate = isPrivate;
-            refreshDrawableState();
-        }
-    }
-
-    public void setTheme(boolean isLight) {
-        // Set the theme only if it is different from existing theme.
-        if ((isLight && mIsLight != isLight) ||
-            (!isLight && mIsDark == isLight)) {
-            if (isLight) {
-                mIsLight = true;
-                mIsDark = false;
-            } else {
-                mIsLight = false;
-                mIsDark = true;
-            }
-
-            refreshDrawableState();
-        }
-    }
-
-    public void resetTheme() {
-        if (mIsLight || mIsDark) {
-            mIsLight = false;
-            mIsDark = false;
-            refreshDrawableState();
-        }
-    }
-
-    public void setAutoUpdateTheme(boolean autoUpdateTheme) {
-        if (mTheme == null) {
-            return;
-        }
-
-        if (mAutoUpdateTheme != autoUpdateTheme) {
-            mAutoUpdateTheme = autoUpdateTheme;
-
-            if (mAutoUpdateTheme)
-                mTheme.addListener(this);
-            else
-                mTheme.removeListener(this);
-        }
-    }
-
-    public ColorDrawable getColorDrawable(int id) {
-        return new ColorDrawable(getResources().getColor(id));
-    }
-}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/widget/ThemedImageView.java.in
@@ -0,0 +1,5 @@
+//#filter substitution
+//#define VIEW_NAME_SUFFIX ImageView
+//#define BASE_TYPE android.widget.ImageView
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
deleted file mode 100644
--- a/mobile/android/base/widget/ThemedLinearLayout.java
+++ /dev/null
@@ -1,150 +0,0 @@
-// This file is generated by generate_themed_views.py; do not edit.
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.widget;
-
-import org.mozilla.gecko.GeckoApplication;
-import org.mozilla.gecko.LightweightTheme;
-import org.mozilla.gecko.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.drawable.ColorDrawable;
-import android.util.AttributeSet;
-
-public class ThemedLinearLayout extends android.widget.LinearLayout
-                                     implements LightweightTheme.OnChangeListener {
-    private LightweightTheme mTheme;
-
-    private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
-    private static final int[] STATE_LIGHT = { R.attr.state_light };
-    private static final int[] STATE_DARK = { R.attr.state_dark };
-
-    protected static final int[] PRIVATE_PRESSED_STATE_SET = { R.attr.state_private, android.R.attr.state_pressed };
-    protected static final int[] PRIVATE_FOCUSED_STATE_SET = { R.attr.state_private, android.R.attr.state_focused };
-    protected static final int[] PRIVATE_STATE_SET = { R.attr.state_private };
-
-    private boolean mIsPrivate;
-    private boolean mIsLight;
-    private boolean mIsDark;
-    private boolean mAutoUpdateTheme;        // always false if there's no theme.
-
-    public ThemedLinearLayout(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initialize(context, attrs);
-    }
-
-    private void initialize(final Context context, final AttributeSet attrs) {
-        // The theme can be null, particularly for webapps: Bug 1089266.
-        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
-
-        final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
-        mAutoUpdateTheme = mTheme != null && a.getBoolean(R.styleable.LightweightTheme_autoUpdateTheme, true);
-        a.recycle();
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.addListener(this);
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.removeListener(this);
-    }
-
-    @Override
-    public int[] onCreateDrawableState(int extraSpace) {
-        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
-
-        if (mIsPrivate)
-            mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
-        else if (mIsLight)
-            mergeDrawableStates(drawableState, STATE_LIGHT);
-        else if (mIsDark)
-            mergeDrawableStates(drawableState, STATE_DARK);
-
-        return drawableState;
-    }
-
-    @Override
-    public void onLightweightThemeChanged() {
-        if (mAutoUpdateTheme && mTheme.isEnabled())
-            setTheme(mTheme.isLightTheme());
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        if (mAutoUpdateTheme)
-            resetTheme();
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        super.onLayout(changed, left, top, right, bottom);
-        onLightweightThemeChanged();
-    }
-
-    public boolean isPrivateMode() {
-        return mIsPrivate;
-    }
-
-    public void setPrivateMode(boolean isPrivate) {
-        if (mIsPrivate != isPrivate) {
-            mIsPrivate = isPrivate;
-            refreshDrawableState();
-        }
-    }
-
-    public void setTheme(boolean isLight) {
-        // Set the theme only if it is different from existing theme.
-        if ((isLight && mIsLight != isLight) ||
-            (!isLight && mIsDark == isLight)) {
-            if (isLight) {
-                mIsLight = true;
-                mIsDark = false;
-            } else {
-                mIsLight = false;
-                mIsDark = true;
-            }
-
-            refreshDrawableState();
-        }
-    }
-
-    public void resetTheme() {
-        if (mIsLight || mIsDark) {
-            mIsLight = false;
-            mIsDark = false;
-            refreshDrawableState();
-        }
-    }
-
-    public void setAutoUpdateTheme(boolean autoUpdateTheme) {
-        if (mTheme == null) {
-            return;
-        }
-
-        if (mAutoUpdateTheme != autoUpdateTheme) {
-            mAutoUpdateTheme = autoUpdateTheme;
-
-            if (mAutoUpdateTheme)
-                mTheme.addListener(this);
-            else
-                mTheme.removeListener(this);
-        }
-    }
-
-    public ColorDrawable getColorDrawable(int id) {
-        return new ColorDrawable(getResources().getColor(id));
-    }
-}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/widget/ThemedLinearLayout.java.in
@@ -0,0 +1,4 @@
+//#filter substitution
+//#define VIEW_NAME_SUFFIX LinearLayout
+//#define BASE_TYPE android.widget.LinearLayout
+//#include ThemedView.java.frag
deleted file mode 100644
--- a/mobile/android/base/widget/ThemedRelativeLayout.java
+++ /dev/null
@@ -1,155 +0,0 @@
-// This file is generated by generate_themed_views.py; do not edit.
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.widget;
-
-import org.mozilla.gecko.GeckoApplication;
-import org.mozilla.gecko.LightweightTheme;
-import org.mozilla.gecko.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.drawable.ColorDrawable;
-import android.util.AttributeSet;
-
-public class ThemedRelativeLayout extends android.widget.RelativeLayout
-                                     implements LightweightTheme.OnChangeListener {
-    private LightweightTheme mTheme;
-
-    private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
-    private static final int[] STATE_LIGHT = { R.attr.state_light };
-    private static final int[] STATE_DARK = { R.attr.state_dark };
-
-    protected static final int[] PRIVATE_PRESSED_STATE_SET = { R.attr.state_private, android.R.attr.state_pressed };
-    protected static final int[] PRIVATE_FOCUSED_STATE_SET = { R.attr.state_private, android.R.attr.state_focused };
-    protected static final int[] PRIVATE_STATE_SET = { R.attr.state_private };
-
-    private boolean mIsPrivate;
-    private boolean mIsLight;
-    private boolean mIsDark;
-    private boolean mAutoUpdateTheme;        // always false if there's no theme.
-
-    public ThemedRelativeLayout(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initialize(context, attrs);
-    }
-
-    public ThemedRelativeLayout(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        initialize(context, attrs);
-    }
-
-    private void initialize(final Context context, final AttributeSet attrs) {
-        // The theme can be null, particularly for webapps: Bug 1089266.
-        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
-
-        final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
-        mAutoUpdateTheme = mTheme != null && a.getBoolean(R.styleable.LightweightTheme_autoUpdateTheme, true);
-        a.recycle();
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.addListener(this);
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.removeListener(this);
-    }
-
-    @Override
-    public int[] onCreateDrawableState(int extraSpace) {
-        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
-
-        if (mIsPrivate)
-            mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
-        else if (mIsLight)
-            mergeDrawableStates(drawableState, STATE_LIGHT);
-        else if (mIsDark)
-            mergeDrawableStates(drawableState, STATE_DARK);
-
-        return drawableState;
-    }
-
-    @Override
-    public void onLightweightThemeChanged() {
-        if (mAutoUpdateTheme && mTheme.isEnabled())
-            setTheme(mTheme.isLightTheme());
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        if (mAutoUpdateTheme)
-            resetTheme();
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        super.onLayout(changed, left, top, right, bottom);
-        onLightweightThemeChanged();
-    }
-
-    public boolean isPrivateMode() {
-        return mIsPrivate;
-    }
-
-    public void setPrivateMode(boolean isPrivate) {
-        if (mIsPrivate != isPrivate) {
-            mIsPrivate = isPrivate;
-            refreshDrawableState();
-        }
-    }
-
-    public void setTheme(boolean isLight) {
-        // Set the theme only if it is different from existing theme.
-        if ((isLight && mIsLight != isLight) ||
-            (!isLight && mIsDark == isLight)) {
-            if (isLight) {
-                mIsLight = true;
-                mIsDark = false;
-            } else {
-                mIsLight = false;
-                mIsDark = true;
-            }
-
-            refreshDrawableState();
-        }
-    }
-
-    public void resetTheme() {
-        if (mIsLight || mIsDark) {
-            mIsLight = false;
-            mIsDark = false;
-            refreshDrawableState();
-        }
-    }
-
-    public void setAutoUpdateTheme(boolean autoUpdateTheme) {
-        if (mTheme == null) {
-            return;
-        }
-
-        if (mAutoUpdateTheme != autoUpdateTheme) {
-            mAutoUpdateTheme = autoUpdateTheme;
-
-            if (mAutoUpdateTheme)
-                mTheme.addListener(this);
-            else
-                mTheme.removeListener(this);
-        }
-    }
-
-    public ColorDrawable getColorDrawable(int id) {
-        return new ColorDrawable(getResources().getColor(id));
-    }
-}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/widget/ThemedRelativeLayout.java.in
@@ -0,0 +1,5 @@
+//#filter substitution
+//#define VIEW_NAME_SUFFIX RelativeLayout
+//#define BASE_TYPE android.widget.RelativeLayout
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
deleted file mode 100644
--- a/mobile/android/base/widget/ThemedTextSwitcher.java
+++ /dev/null
@@ -1,150 +0,0 @@
-// This file is generated by generate_themed_views.py; do not edit.
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.widget;
-
-import org.mozilla.gecko.GeckoApplication;
-import org.mozilla.gecko.LightweightTheme;
-import org.mozilla.gecko.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.drawable.ColorDrawable;
-import android.util.AttributeSet;
-
-public class ThemedTextSwitcher extends android.widget.TextSwitcher
-                                     implements LightweightTheme.OnChangeListener {
-    private LightweightTheme mTheme;
-
-    private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
-    private static final int[] STATE_LIGHT = { R.attr.state_light };
-    private static final int[] STATE_DARK = { R.attr.state_dark };
-
-    protected static final int[] PRIVATE_PRESSED_STATE_SET = { R.attr.state_private, android.R.attr.state_pressed };
-    protected static final int[] PRIVATE_FOCUSED_STATE_SET = { R.attr.state_private, android.R.attr.state_focused };
-    protected static final int[] PRIVATE_STATE_SET = { R.attr.state_private };
-
-    private boolean mIsPrivate;
-    private boolean mIsLight;
-    private boolean mIsDark;
-    private boolean mAutoUpdateTheme;        // always false if there's no theme.
-
-    public ThemedTextSwitcher(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initialize(context, attrs);
-    }
-
-    private void initialize(final Context context, final AttributeSet attrs) {
-        // The theme can be null, particularly for webapps: Bug 1089266.
-        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
-
-        final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
-        mAutoUpdateTheme = mTheme != null && a.getBoolean(R.styleable.LightweightTheme_autoUpdateTheme, true);
-        a.recycle();
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.addListener(this);
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.removeListener(this);
-    }
-
-    @Override
-    public int[] onCreateDrawableState(int extraSpace) {
-        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
-
-        if (mIsPrivate)
-            mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
-        else if (mIsLight)
-            mergeDrawableStates(drawableState, STATE_LIGHT);
-        else if (mIsDark)
-            mergeDrawableStates(drawableState, STATE_DARK);
-
-        return drawableState;
-    }
-
-    @Override
-    public void onLightweightThemeChanged() {
-        if (mAutoUpdateTheme && mTheme.isEnabled())
-            setTheme(mTheme.isLightTheme());
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        if (mAutoUpdateTheme)
-            resetTheme();
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        super.onLayout(changed, left, top, right, bottom);
-        onLightweightThemeChanged();
-    }
-
-    public boolean isPrivateMode() {
-        return mIsPrivate;
-    }
-
-    public void setPrivateMode(boolean isPrivate) {
-        if (mIsPrivate != isPrivate) {
-            mIsPrivate = isPrivate;
-            refreshDrawableState();
-        }
-    }
-
-    public void setTheme(boolean isLight) {
-        // Set the theme only if it is different from existing theme.
-        if ((isLight && mIsLight != isLight) ||
-            (!isLight && mIsDark == isLight)) {
-            if (isLight) {
-                mIsLight = true;
-                mIsDark = false;
-            } else {
-                mIsLight = false;
-                mIsDark = true;
-            }
-
-            refreshDrawableState();
-        }
-    }
-
-    public void resetTheme() {
-        if (mIsLight || mIsDark) {
-            mIsLight = false;
-            mIsDark = false;
-            refreshDrawableState();
-        }
-    }
-
-    public void setAutoUpdateTheme(boolean autoUpdateTheme) {
-        if (mTheme == null) {
-            return;
-        }
-
-        if (mAutoUpdateTheme != autoUpdateTheme) {
-            mAutoUpdateTheme = autoUpdateTheme;
-
-            if (mAutoUpdateTheme)
-                mTheme.addListener(this);
-            else
-                mTheme.removeListener(this);
-        }
-    }
-
-    public ColorDrawable getColorDrawable(int id) {
-        return new ColorDrawable(getResources().getColor(id));
-    }
-}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/widget/ThemedTextSwitcher.java.in
@@ -0,0 +1,4 @@
+//#filter substitution
+//#define VIEW_NAME_SUFFIX TextSwitcher
+//#define BASE_TYPE android.widget.TextSwitcher
+//#include ThemedView.java.frag
deleted file mode 100644
--- a/mobile/android/base/widget/ThemedTextView.java
+++ /dev/null
@@ -1,155 +0,0 @@
-// This file is generated by generate_themed_views.py; do not edit.
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.widget;
-
-import org.mozilla.gecko.GeckoApplication;
-import org.mozilla.gecko.LightweightTheme;
-import org.mozilla.gecko.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.drawable.ColorDrawable;
-import android.util.AttributeSet;
-
-public class ThemedTextView extends android.widget.TextView
-                                     implements LightweightTheme.OnChangeListener {
-    private LightweightTheme mTheme;
-
-    private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
-    private static final int[] STATE_LIGHT = { R.attr.state_light };
-    private static final int[] STATE_DARK = { R.attr.state_dark };
-
-    protected static final int[] PRIVATE_PRESSED_STATE_SET = { R.attr.state_private, android.R.attr.state_pressed };
-    protected static final int[] PRIVATE_FOCUSED_STATE_SET = { R.attr.state_private, android.R.attr.state_focused };
-    protected static final int[] PRIVATE_STATE_SET = { R.attr.state_private };
-
-    private boolean mIsPrivate;
-    private boolean mIsLight;
-    private boolean mIsDark;
-    private boolean mAutoUpdateTheme;        // always false if there's no theme.
-
-    public ThemedTextView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initialize(context, attrs);
-    }
-
-    public ThemedTextView(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        initialize(context, attrs);
-    }
-
-    private void initialize(final Context context, final AttributeSet attrs) {
-        // The theme can be null, particularly for webapps: Bug 1089266.
-        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
-
-        final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
-        mAutoUpdateTheme = mTheme != null && a.getBoolean(R.styleable.LightweightTheme_autoUpdateTheme, true);
-        a.recycle();
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.addListener(this);
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.removeListener(this);
-    }
-
-    @Override
-    public int[] onCreateDrawableState(int extraSpace) {
-        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
-
-        if (mIsPrivate)
-            mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
-        else if (mIsLight)
-            mergeDrawableStates(drawableState, STATE_LIGHT);
-        else if (mIsDark)
-            mergeDrawableStates(drawableState, STATE_DARK);
-
-        return drawableState;
-    }
-
-    @Override
-    public void onLightweightThemeChanged() {
-        if (mAutoUpdateTheme && mTheme.isEnabled())
-            setTheme(mTheme.isLightTheme());
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        if (mAutoUpdateTheme)
-            resetTheme();
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        super.onLayout(changed, left, top, right, bottom);
-        onLightweightThemeChanged();
-    }
-
-    public boolean isPrivateMode() {
-        return mIsPrivate;
-    }
-
-    public void setPrivateMode(boolean isPrivate) {
-        if (mIsPrivate != isPrivate) {
-            mIsPrivate = isPrivate;
-            refreshDrawableState();
-        }
-    }
-
-    public void setTheme(boolean isLight) {
-        // Set the theme only if it is different from existing theme.
-        if ((isLight && mIsLight != isLight) ||
-            (!isLight && mIsDark == isLight)) {
-            if (isLight) {
-                mIsLight = true;
-                mIsDark = false;
-            } else {
-                mIsLight = false;
-                mIsDark = true;
-            }
-
-            refreshDrawableState();
-        }
-    }
-
-    public void resetTheme() {
-        if (mIsLight || mIsDark) {
-            mIsLight = false;
-            mIsDark = false;
-            refreshDrawableState();
-        }
-    }
-
-    public void setAutoUpdateTheme(boolean autoUpdateTheme) {
-        if (mTheme == null) {
-            return;
-        }
-
-        if (mAutoUpdateTheme != autoUpdateTheme) {
-            mAutoUpdateTheme = autoUpdateTheme;
-
-            if (mAutoUpdateTheme)
-                mTheme.addListener(this);
-            else
-                mTheme.removeListener(this);
-        }
-    }
-
-    public ColorDrawable getColorDrawable(int id) {
-        return new ColorDrawable(getResources().getColor(id));
-    }
-}
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/widget/ThemedTextView.java.in
@@ -0,0 +1,5 @@
+//#filter substitution
+//#define VIEW_NAME_SUFFIX TextView
+//#define BASE_TYPE android.widget.TextView
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
deleted file mode 100644
--- a/mobile/android/base/widget/ThemedView.java
+++ /dev/null
@@ -1,155 +0,0 @@
-// This file is generated by generate_themed_views.py; do not edit.
-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-package org.mozilla.gecko.widget;
-
-import org.mozilla.gecko.GeckoApplication;
-import org.mozilla.gecko.LightweightTheme;
-import org.mozilla.gecko.R;
-
-import android.content.Context;
-import android.content.res.TypedArray;
-import android.graphics.drawable.ColorDrawable;
-import android.util.AttributeSet;
-
-public class ThemedView extends android.view.View
-                                     implements LightweightTheme.OnChangeListener {
-    private LightweightTheme mTheme;
-
-    private static final int[] STATE_PRIVATE_MODE = { R.attr.state_private };
-    private static final int[] STATE_LIGHT = { R.attr.state_light };
-    private static final int[] STATE_DARK = { R.attr.state_dark };
-
-    protected static final int[] PRIVATE_PRESSED_STATE_SET = { R.attr.state_private, android.R.attr.state_pressed };
-    protected static final int[] PRIVATE_FOCUSED_STATE_SET = { R.attr.state_private, android.R.attr.state_focused };
-    protected static final int[] PRIVATE_STATE_SET = { R.attr.state_private };
-
-    private boolean mIsPrivate;
-    private boolean mIsLight;
-    private boolean mIsDark;
-    private boolean mAutoUpdateTheme;        // always false if there's no theme.
-
-    public ThemedView(Context context, AttributeSet attrs) {
-        super(context, attrs);
-        initialize(context, attrs);
-    }
-
-    public ThemedView(Context context, AttributeSet attrs, int defStyle) {
-        super(context, attrs, defStyle);
-        initialize(context, attrs);
-    }
-
-    private void initialize(final Context context, final AttributeSet attrs) {
-        // The theme can be null, particularly for webapps: Bug 1089266.
-        mTheme = ((GeckoApplication) context.getApplicationContext()).getLightweightTheme();
-
-        final TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.LightweightTheme);
-        mAutoUpdateTheme = mTheme != null && a.getBoolean(R.styleable.LightweightTheme_autoUpdateTheme, true);
-        a.recycle();
-    }
-
-    @Override
-    public void onAttachedToWindow() {
-        super.onAttachedToWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.addListener(this);
-    }
-
-    @Override
-    public void onDetachedFromWindow() {
-        super.onDetachedFromWindow();
-
-        if (mAutoUpdateTheme)
-            mTheme.removeListener(this);
-    }
-
-    @Override
-    public int[] onCreateDrawableState(int extraSpace) {
-        final int[] drawableState = super.onCreateDrawableState(extraSpace + 1);
-
-        if (mIsPrivate)
-            mergeDrawableStates(drawableState, STATE_PRIVATE_MODE);
-        else if (mIsLight)
-            mergeDrawableStates(drawableState, STATE_LIGHT);
-        else if (mIsDark)
-            mergeDrawableStates(drawableState, STATE_DARK);
-
-        return drawableState;
-    }
-
-    @Override
-    public void onLightweightThemeChanged() {
-        if (mAutoUpdateTheme && mTheme.isEnabled())
-            setTheme(mTheme.isLightTheme());
-    }
-
-    @Override
-    public void onLightweightThemeReset() {
-        if (mAutoUpdateTheme)
-            resetTheme();
-    }
-
-    @Override
-    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
-        super.onLayout(changed, left, top, right, bottom);
-        onLightweightThemeChanged();
-    }
-
-    public boolean isPrivateMode() {
-        return mIsPrivate;
-    }
-
-    public void setPrivateMode(boolean isPrivate) {
-        if (mIsPrivate != isPrivate) {
-            mIsPrivate = isPrivate;
-            refreshDrawableState();
-        }
-    }
-
-    public void setTheme(boolean isLight) {
-        // Set the theme only if it is different from existing theme.
-        if ((isLight && mIsLight != isLight) ||
-            (!isLight && mIsDark == isLight)) {
-            if (isLight) {
-                mIsLight = true;
-                mIsDark = false;
-            } else {
-                mIsLight = false;
-                mIsDark = true;
-            }
-
-            refreshDrawableState();
-        }
-    }
-
-    public void resetTheme() {
-        if (mIsLight || mIsDark) {
-            mIsLight = false;
-            mIsDark = false;
-            refreshDrawableState();
-        }
-    }
-
-    public void setAutoUpdateTheme(boolean autoUpdateTheme) {
-        if (mTheme == null) {
-            return;
-        }
-
-        if (mAutoUpdateTheme != autoUpdateTheme) {
-            mAutoUpdateTheme = autoUpdateTheme;
-
-            if (mAutoUpdateTheme)
-                mTheme.addListener(this);
-            else
-                mTheme.removeListener(this);
-        }
-    }
-
-    public ColorDrawable getColorDrawable(int id) {
-        return new ColorDrawable(getResources().getColor(id));
-    }
-}
--- a/mobile/android/base/widget/ThemedView.java.frag
+++ b/mobile/android/base/widget/ThemedView.java.frag
@@ -1,11 +1,8 @@
-//#filter substitution
-// This file is generated by generate_themed_views.py; do not edit.
-
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.widget;
 
 import org.mozilla.gecko.GeckoApplication;
 import org.mozilla.gecko.LightweightTheme;
new file mode 100644
--- /dev/null
+++ b/mobile/android/base/widget/ThemedView.java.in
@@ -0,0 +1,5 @@
+//#filter substitution
+//#define VIEW_NAME_SUFFIX View
+//#define BASE_TYPE android.view.View
+//#define STYLE_CONSTRUCTOR 1
+//#include ThemedView.java.frag
deleted file mode 100644
--- a/mobile/android/base/widget/generate_themed_views.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/python
-
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-'''
-Script to generate Themed*.java source files for Fennec.
-
-This script runs the preprocessor on a input template and writes
-updated files into the source directory.
-
-To update the themed views, update the input template
-(ThemedView.java.frag) and run the script.  Use version control to
-examine the differences, and don't forget to commit the changes to the
-template and the outputs.
-'''
-
-from __future__ import (
-    print_function,
-    unicode_literals,
-)
-
-import os
-
-from mozbuild.preprocessor import Preprocessor
-
-__DIR__ = os.path.dirname(os.path.abspath(__file__))
-
-template = os.path.join(__DIR__, 'ThemedView.java.frag')
-dest_format_string = 'Themed%(VIEW_NAME_SUFFIX)s.java'
-
-views = [
-    dict(VIEW_NAME_SUFFIX='EditText',
-         BASE_TYPE='android.widget.EditText',
-         STYLE_CONSTRUCTOR=1),
-    dict(VIEW_NAME_SUFFIX='ImageButton',
-         BASE_TYPE='android.widget.ImageButton',
-         STYLE_CONSTRUCTOR=1),
-    dict(VIEW_NAME_SUFFIX='ImageView',
-         BASE_TYPE='android.widget.ImageView',
-         STYLE_CONSTRUCTOR=1),
-    dict(VIEW_NAME_SUFFIX='LinearLayout',
-         BASE_TYPE='android.widget.LinearLayout'),
-    dict(VIEW_NAME_SUFFIX='RelativeLayout',
-         BASE_TYPE='android.widget.RelativeLayout',
-         STYLE_CONSTRUCTOR=1),
-    dict(VIEW_NAME_SUFFIX='TextSwitcher',
-         BASE_TYPE='android.widget.TextSwitcher'),
-    dict(VIEW_NAME_SUFFIX='TextView',
-         BASE_TYPE='android.widget.TextView',
-         STYLE_CONSTRUCTOR=1),
-    dict(VIEW_NAME_SUFFIX='View',
-         BASE_TYPE='android.view.View',
-         STYLE_CONSTRUCTOR=1),
-]
-
-for view in views:
-    pp = Preprocessor(defines=view, marker='//#')
-
-    dest = os.path.join(__DIR__, dest_format_string % view)
-    with open(template, 'rU') as input:
-        with open(dest, 'wt') as output:
-            pp.processFile(input=input, output=output)
-            print('%s' % dest)