Bug 833427: Remove homescreen widget. [r=mfinkle]

--HG--
extra : rebase_source : 1b447efd820eff6b7f1d7bd223613e80525e64e0
This commit is contained in:
Sriram Ramasubramanian 2013-01-22 11:19:35 -08:00
parent c04652f376
commit 5605c312ef
40 changed files with 3 additions and 145 deletions

View File

@ -132,7 +132,6 @@ abstract public class GeckoApp
public static final String ACTION_BOOKMARK = "org.mozilla.gecko.BOOKMARK";
public static final String ACTION_LOAD = "org.mozilla.gecko.LOAD";
public static final String ACTION_INIT_PW = "org.mozilla.gecko.INIT_PW";
public static final String ACTION_WIDGET = "org.mozilla.gecko.WIDGET";
public static final String SAVED_STATE_IN_BACKGROUND = "inBackground";
public static final String SAVED_STATE_PRIVATE_SESSION = "privateSession";
@ -1747,14 +1746,7 @@ abstract public class GeckoApp
GeckoAppShell.sendEventToGecko(GeckoEvent.createBroadcastEvent("Viewport:Flush", null));
}
// Homescreen Widget requests awesome bar
if (ACTION_WIDGET.equals(action)) {
if (mRestoreMode != RESTORE_NONE && !mIsRestoringActivity) {
addTab();
} else {
onSearchRequested();
}
} else if (ACTION_ALERT_CALLBACK.equals(action)) {
if (ACTION_ALERT_CALLBACK.equals(action)) {
processAlertCallback(intent);
}
}
@ -1900,8 +1892,6 @@ abstract public class GeckoApp
GeckoAppShell.sendEventToGecko(GeckoEvent.createURILoadEvent(uri));
} else if (ACTION_ALERT_CALLBACK.equals(action)) {
processAlertCallback(intent);
} else if (ACTION_WIDGET.equals(action)) {
addTab();
}
}

View File

@ -1,46 +0,0 @@
/* 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/. */
#filter substitution
package @ANDROID_PACKAGE_NAME@;
import org.mozilla.gecko.GeckoApp;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.app.PendingIntent;
import android.widget.RemoteViews;
import org.mozilla.gecko.R;
public class GeckoAppWidgetProvider extends AppWidgetProvider {
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
for (int i=0; i < appWidgetIds.length; i++) {
int appWidgetId = appWidgetIds[i];
// Launch the AwesomeScreen on tapping the URL bar.
Intent awesomeBarIntent = new Intent();
awesomeBarIntent.setComponent(new ComponentName("@ANDROID_PACKAGE_NAME@", "@ANDROID_PACKAGE_NAME@.App"));
awesomeBarIntent.setAction(GeckoApp.ACTION_WIDGET);
PendingIntent pendingAwesomeBarIntent = PendingIntent.getActivity(context, 0, awesomeBarIntent, 0);
// Launch the App on tapping the icon.
Intent iconIntent = new Intent();
iconIntent.setComponent(new ComponentName("@ANDROID_PACKAGE_NAME@", "@ANDROID_PACKAGE_NAME@.App"));
PendingIntent pendingIconIntent = PendingIntent.getActivity(context, 0, iconIntent, 0);
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.gecko_appwidget);
views.setOnClickPendingIntent(R.id.awesome_bar, pendingAwesomeBarIntent);
views.setOnClickPendingIntent(R.id.icon, pendingIconIntent);
// Update the view.
appWidgetManager.updateAppWidget(appWidgetId, views);
}
}
}

View File

@ -239,7 +239,6 @@ FENNEC_PP_JAVA_FILES = \
WebApps.java \
GeckoActivity.java \
GeckoAppInfo.java \
GeckoAppWidgetProvider.java \
LauncherShortcuts.java \
Restarter.java \
db/BrowserContract.java \
@ -400,7 +399,6 @@ RES_LAYOUT = \
res/layout/find_in_page_content.xml \
res/layout/font_size_preference.xml \
res/layout/gecko_app.xml \
res/layout/gecko_appwidget.xml \
res/layout/web_app.xml \
res/layout/launch_app_list.xml \
res/layout/launch_app_listitem.xml \
@ -517,7 +515,6 @@ RES_VALUES_V14 = \
$(NULL)
RES_XML = \
res/xml/gecko_appwidget_info.xml \
$(SYNC_RES_XML) \
$(NULL)
@ -548,7 +545,6 @@ RES_DRAWABLE_MDPI = \
res/drawable-mdpi/alert_addon.png \
res/drawable-mdpi/alert_app.png \
res/drawable-mdpi/alert_download.png \
res/drawable-mdpi/appwidget_bg.9.png \
res/drawable-mdpi/autocomplete_list_bg.9.png \
res/drawable-mdpi/awesomebar_tab_center.9.png \
res/drawable-mdpi/awesomebar_tab_left.9.png \
@ -661,7 +657,6 @@ RES_DRAWABLE_HDPI = \
res/drawable-hdpi/alert_addon.png \
res/drawable-hdpi/alert_app.png \
res/drawable-hdpi/alert_download.png \
res/drawable-hdpi/appwidget_bg.9.png \
res/drawable-hdpi/awesomebar_tab_center.9.png \
res/drawable-hdpi/awesomebar_tab_left.9.png \
res/drawable-hdpi/awesomebar_tab_right.9.png \
@ -752,7 +747,6 @@ RES_DRAWABLE_XHDPI = \
res/drawable-xhdpi/alert_addon.png \
res/drawable-xhdpi/alert_app.png \
res/drawable-xhdpi/alert_download.png \
res/drawable-xhdpi/appwidget_bg.9.png \
res/drawable-xhdpi/awesomebar_tab_center.9.png \
res/drawable-xhdpi/awesomebar_tab_left.9.png \
res/drawable-xhdpi/awesomebar_tab_right.9.png \
@ -1031,8 +1025,6 @@ MOZ_ANDROID_DRAWABLES += \
$(NULL)
MOZ_BRANDING_DRAWABLE_MDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources.mn | tr '\n' ' '; fi)
MOZ_BRANDING_DRAWABLE_HDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-hdpi.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-hdpi.mn | tr '\n' ' '; fi)
MOZ_BRANDING_DRAWABLE_XHDPI = $(shell if test -e $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-xhdpi.mn; then cat $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/android-resources-xhdpi.mn | tr '\n' ' '; fi)
RESOURCES=$(RES_LAYOUT) $(RES_LAYOUT_LAND_V14) $(RES_LAYOUT_LARGE_LAND_V11) $(RES_LAYOUT_LARGE_V11) $(RES_LAYOUT_XLARGE_V11) $(RES_LAYOUT_XLARGE_LAND_V11) $(RES_VALUES) $(RES_VALUES_LAND) $(RES_VALUES_V11) $(RES_VALUES_LARGE_V11) $(RES_VALUES_LARGE_LAND_V11) $(RES_VALUES_XLARGE_V11) $(RES_VALUES_LAND_V14) $(RES_VALUES_V14) $(RES_XML) $(RES_ANIM) $(RES_DRAWABLE_MDPI) $(RES_DRAWABLE_LDPI) $(RES_DRAWABLE_HDPI) $(RES_DRAWABLE_XHDPI) $(RES_DRAWABLE_MDPI_V11) $(RES_DRAWABLE_HDPI_V11) $(RES_DRAWABLE_XHDPI_V11) $(RES_DRAWABLE_LAND_MDPI_V14) $(RES_DRAWABLE_LAND_HDPI_V14) $(RES_DRAWABLE_LAND_XHDPI_V14) $(RES_DRAWABLE_LARGE_LAND_V11) $(RES_DRAWABLE_LARGE_MDPI_V11) $(RES_DRAWABLE_LARGE_HDPI_V11) $(RES_DRAWABLE_LARGE_XHDPI_V11) $(RES_DRAWABLE_XLARGE_MDPI_V11) $(RES_DRAWABLE_XLARGE_HDPI_V11) $(RES_DRAWABLE_XLARGE_XHDPI_V11) $(RES_COLOR) $(RES_MENU)
@ -1216,16 +1208,6 @@ $(RES_BRANDING_DRAWABLE_MDPI): $(addprefix $(topsrcdir)/,$(MOZ_BRANDING_DRAWABLE
$(NSINSTALL) -D res/drawable-mdpi
$(NSINSTALL) $^ res/drawable-mdpi/
RES_BRANDING_DRAWABLE_HDPI = $(addprefix res/drawable-hdpi/,$(notdir $(MOZ_BRANDING_DRAWABLE_HDPI)))
$(RES_BRANDING_DRAWABLE_HDPI): $(addprefix $(topsrcdir)/,$(MOZ_BRANDING_DRAWABLE_HDPI))
$(NSINSTALL) -D res/drawable-hdpi
$(NSINSTALL) $^ res/drawable-hdpi/
RES_BRANDING_DRAWABLE_XHDPI = $(addprefix res/drawable-xhdpi/,$(notdir $(MOZ_BRANDING_DRAWABLE_XHDPI)))
$(RES_BRANDING_DRAWABLE_XHDPI): $(addprefix $(topsrcdir)/,$(MOZ_BRANDING_DRAWABLE_XHDPI))
$(NSINSTALL) -D res/drawable-xhdpi
$(NSINSTALL) $^ res/drawable-xhdpi/
$(RES_DIRS):
$(RM) -r $@
$(NSINSTALL) -D $@
@ -1235,10 +1217,10 @@ $(RESOURCES): $(RES_DIRS) $(subst res/,$(srcdir)/resources/,$(RESOURCES))
$(NSINSTALL) $(subst res/,$(srcdir)/resources/,$@) $(dir $@)
R.java: $(MOZ_APP_ICON) $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDPI) $(RES_BRANDING_DRAWABLE_HDPI) $(RES_BRANDING_DRAWABLE_XHDPI) $(PP_RES_XML) res/drawable-mdpi/icon.png res/drawable-hdpi/icon.png res/drawable-xhdpi/icon.png res/drawable-xxhdpi/icon.png res/values/strings.xml AndroidManifest.xml FORCE
R.java: $(MOZ_APP_ICON) $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDPI) $(PP_RES_XML) res/drawable-mdpi/icon.png res/drawable-hdpi/icon.png res/drawable-xhdpi/icon.png res/drawable-xxhdpi/icon.png res/values/strings.xml AndroidManifest.xml FORCE
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -J . --custom-package org.mozilla.gecko
gecko.ap_: AndroidManifest.xml res/drawable-mdpi/icon.png res/drawable-hdpi/icon.png res/drawable-xhdpi/icon.png res/drawable-xxhdpi/icon.png $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDPI) $(RES_BRANDING_DRAWABLE_HDPI) $(RES_BRANDING_DRAWABLE_XHDPI) $(PP_RES_XML) res/values/strings.xml FORCE
gecko.ap_: AndroidManifest.xml res/drawable-mdpi/icon.png res/drawable-hdpi/icon.png res/drawable-xhdpi/icon.png res/drawable-xxhdpi/icon.png $(RESOURCES) $(RES_DRAWABLE) $(RES_BRANDING_DRAWABLE_MDPI) $(PP_RES_XML) res/values/strings.xml FORCE
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -F $@
libs:: classes.dex package-name.txt jni-stubs.inc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1002 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,45 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="54dp"
android:paddingLeft="@dimen/widget_padding"
android:paddingRight="@dimen/widget_padding"
android:gravity="center_vertical"
android:layout_gravity="center_vertical">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="48dp"
android:layout_marginTop="3dp"
android:layout_marginLeft="25dp"
android:layout_alignParentTop="true"
android:orientation="horizontal"
android:background="@drawable/appwidget_bg"
android:layout_gravity="center_vertical">
<Button android:id="@+id/awesome_bar"
android:layout_width="fill_parent"
android:layout_height="36dp"
android:layout_marginTop="2dp"
android:layout_marginBottom="2dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="4dp"
android:background="@drawable/address_bar_url"
android:singleLine="true"
android:gravity="center_vertical|left"
android:hint="@string/awesomebar_default_text"
android:textSize="16sp"
android:textColor="#222222"
android:paddingLeft="25dp"
android:paddingRight="10dp"/>
</LinearLayout>
<ImageButton android:id="@+id/icon"
android:layout_width="54dp"
android:layout_height="54dp"
android:background="@drawable/widget_icon"
android:scaleType="fitXY"
android:layout_marginTop="-2dp"
android:layout_alignParentTop="true" />
</RelativeLayout>

View File

@ -6,6 +6,5 @@
<resources>
<dimen name="tabs_counter_size">22sp</dimen>
<dimen name="widget_padding">0dp</dimen>
</resources>

View File

@ -60,7 +60,6 @@
<dimen name="text_selection_handle_shadow">2dp</dimen>
<dimen name="validation_message_height">50dp</dimen>
<dimen name="validation_message_margin_top">6dp</dimen>
<dimen name="widget_padding">8dp</dimen>
<dimen name="forward_default_offset">-11dip</dimen>
<dimen name="addressbar_offset_left">90dp</dimen>
<dimen name="addressbar_offset_left_noforward">50dip</dimen>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="270dp"
android:minHeight="54dp"
android:initialLayout="@layout/gecko_appwidget"
android:resizeMode="horizontal"/>

View File

@ -1 +0,0 @@
mobile/android/branding/aurora/content/hdpi/widget_icon.png

View File

@ -1 +0,0 @@
mobile/android/branding/aurora/content/xhdpi/widget_icon.png

View File

@ -1,3 +1,2 @@
mobile/android/branding/aurora/content/logo.png
mobile/android/branding/aurora/content/favicon32.png
mobile/android/branding/aurora/content/mdpi/widget_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@ -1 +0,0 @@
mobile/android/branding/beta/content/hdpi/widget_icon.png

View File

@ -1 +0,0 @@
mobile/android/branding/beta/content/xhdpi/widget_icon.png

View File

@ -1,3 +1,2 @@
mobile/android/branding/beta/content/logo.png
mobile/android/branding/beta/content/favicon32.png
mobile/android/branding/beta/content/mdpi/widget_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1 +0,0 @@
mobile/android/branding/nightly/content/hdpi/widget_icon.png

View File

@ -1 +0,0 @@
mobile/android/branding/nightly/content/xhdpi/widget_icon.png

View File

@ -1,3 +1,2 @@
mobile/android/branding/nightly/content/logo.png
mobile/android/branding/nightly/content/favicon32.png
mobile/android/branding/nightly/content/mdpi/widget_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

View File

@ -1 +0,0 @@
mobile/android/branding/official/content/hdpi/widget_icon.png

View File

@ -1 +0,0 @@
mobile/android/branding/official/content/xhdpi/widget_icon.png

View File

@ -1,3 +1,2 @@
mobile/android/branding/official/content/logo.png
mobile/android/branding/official/content/favicon32.png
mobile/android/branding/official/content/mdpi/widget_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

View File

@ -1 +0,0 @@
mobile/android/branding/unofficial/content/hdpi/widget_icon.png

View File

@ -1 +0,0 @@
mobile/android/branding/unofficial/content/xhdpi/widget_icon.png

View File

@ -1,3 +1,2 @@
mobile/android/branding/unofficial/content/favicon32.png
mobile/android/branding/unofficial/content/logo.png
mobile/android/branding/unofficial/content/mdpi/widget_icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB