diff --git a/mobile/android/app/Makefile.in b/mobile/android/app/Makefile.in index 2c3f42be6e1..ca31ee832b3 100644 --- a/mobile/android/app/Makefile.in +++ b/mobile/android/app/Makefile.in @@ -45,6 +45,7 @@ include $(DEPTH)/config/autoconf.mk DIRS = profile/extensions PREF_JS_EXPORTS = $(srcdir)/mobile.js +DIST_FILES = recommended-addons.json ifndef LIBXUL_SDK ifneq (Android,$(OS_TARGET)) diff --git a/mobile/android/app/recommended-addons.json b/mobile/android/app/recommended-addons.json new file mode 100644 index 00000000000..260dec1f64b --- /dev/null +++ b/mobile/android/app/recommended-addons.json @@ -0,0 +1 @@ +{"addons":[{"id":"cleary@digdug.org","name":"Cleary","type":"extension","version":"1.1","repositoryStatus":4,"creator":{"name":"DigDug","url":"https://addons.mozilla.org/en-US/mobile/user/47146/?src=api"},"description":"Creates a subpage for clearing everything, history, passwords, or just site settings for small time durations. Also adds option to clear everything on shutdown (You'll need to add Quit Fennec in order to have a quit button).","fullDescription":"Creates a subpage for clearing small sets of prefs for certain time durations. Also adds options for \"Clear on shutdown\".","iconURL":"http://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/292493-32.png?modified=1310547725","isPlatformCompatible":true,"eula":null,"screenshots":[{"url":"https://static-cdn.addons.mozilla.net/img/uploads/previews/full/58/58448.png?src=api&modified=1306791981","thumbnailURL":"https://static-cdn.addons.mozilla.net/img/uploads/previews/thumbs/58/58448.png?src=api&modified=1306791981","caption":"The new settings screen. Clicking on the Clear row will show the a subpage with detailed options. You can also select to have Fennec clear history on shutdown (using the Quit Firefox addon)."},{"url":"https://static-cdn.addons.mozilla.net/img/uploads/previews/full/58/58449.png?src=api&modified=1306791981","thumbnailURL":"https://static-cdn.addons.mozilla.net/img/uploads/previews/thumbs/58/58449.png?src=api&modified=1306791981","caption":"The sub options. Clicking any of the clear buttons will clear just that set of history for the time period shown at the top."}],"averageRating":2,"homepageURL":"https://addons.mozilla.org/en-US/mobile/addon/cleary/?src=api","sourceURI":{"spec":"https://addons.mozilla.org/mobile/downloads/file/126109/cleary-1.1-fn-android.xpi?src=api","prePath":"https://addons.mozilla.org","scheme":"https","userPass":"","username":"","password":"","hostPort":"addons.mozilla.org","host":"addons.mozilla.org","port":-1,"path":"/mobile/downloads/file/126109/cleary-1.1-fn-android.xpi?src=api","asciiSpec":"https://addons.mozilla.org/mobile/downloads/file/126109/cleary-1.1-fn-android.xpi?src=api","asciiHost":"addons.mozilla.org","originCharset":"UTF-8","ref":""},"size":11264,"developerComments":"Added repository at: http://hg.mozilla.org/users/wjohnston_mozilla.com/cleary","reviewURL":"https://addons.mozilla.org/en-US/mobile/addon/cleary/reviews/?src=api","reviewCount":2,"totalDownloads":145132,"weeklyDownloads":8825,"dailyUsers":13879,"updateDate":"2011-07-13T09:01:17.000Z","supportURL":"http://hg.mozilla.org/users/wjohnston_mozilla.com/cleary","install":{"name":"Cleary","type":null,"version":"1.1","iconURL":"https://static-cdn.addons.mozilla.net/en-US/firefox/images/addon_icon/292493-32.png?modified=1310547725","releaseNotesURI":null,"file":null,"state":0,"error":0,"progress":0,"maxProgress":-1,"certificate":null,"certName":null,"existingAddon":null,"addon":null,"sourceURI":{"spec":"https://addons.mozilla.org/mobile/downloads/file/126109/cleary-1.1-fn-android.xpi?src=api","prePath":"https://addons.mozilla.org","scheme":"https","userPass":"","username":"","password":"","hostPort":"addons.mozilla.org","host":"addons.mozilla.org","port":-1,"path":"/mobile/downloads/file/126109/cleary-1.1-fn-android.xpi?src=api","asciiSpec":"https://addons.mozilla.org/mobile/downloads/file/126109/cleary-1.1-fn-android.xpi?src=api","asciiHost":"addons.mozilla.org","originCharset":"UTF-8","ref":""},"linkedInstalls":null}},{"id":"clearhistory@mbrubeck.limpet.net","name":"Clear Mobile History","type":"extension","version":"1.0.2","repositoryStatus":4,"creator":{"name":"Matt Brubeck","url":"https://addons.mozilla.org/en-US/mobile/user/5283521/?src=api"},"description":"Add a \"Clear History\" button to the Firefox preferences.","fullDescription":"Clear your mobile Firefox history without clearing your cookies, passwords, etc.","iconURL":"http://static-cdn.addons.mozilla.net/media//img/addon-icons/security-32.png","isPlatformCompatible":true,"eula":null,"screenshots":[{"url":"https://static-cdn.addons.mozilla.net/img/uploads/previews/full/54/54824.png?src=api&modified=1299604932","thumbnailURL":"https://static-cdn.addons.mozilla.net/img/uploads/previews/thumbs/54/54824.png?src=api&modified=1299604932","caption":null}],"averageRating":2,"homepageURL":"https://addons.mozilla.org/en-US/mobile/addon/clear-mobile-history/?src=api","sourceURI":{"spec":"https://addons.mozilla.org/mobile/downloads/file/126990/clear_mobile_history-1.0.2-fn-android.xpi?src=api","prePath":"https://addons.mozilla.org","scheme":"https","userPass":"","username":"","password":"","hostPort":"addons.mozilla.org","host":"addons.mozilla.org","port":-1,"path":"/mobile/downloads/file/126990/clear_mobile_history-1.0.2-fn-android.xpi?src=api","asciiSpec":"https://addons.mozilla.org/mobile/downloads/file/126990/clear_mobile_history-1.0.2-fn-android.xpi?src=api","asciiHost":"addons.mozilla.org","originCharset":"UTF-8","ref":""},"size":2048,"developerComments":"Source code is available at: http://hg.mozilla.org/users/mbrubeck_mozilla.com/clearhistory/","reviewURL":"https://addons.mozilla.org/en-US/mobile/addon/clear-mobile-history/reviews/?src=api","reviewCount":2,"totalDownloads":331354,"weeklyDownloads":16899,"dailyUsers":33852,"updateDate":"2011-07-22T18:20:07.000Z","supportURL":null,"install":{"name":"Clear Mobile History","type":null,"version":"1.0.2","iconURL":"https://static-cdn.addons.mozilla.net/media//img/addon-icons/security-32.png","releaseNotesURI":null,"file":null,"state":0,"error":0,"progress":0,"maxProgress":-1,"certificate":null,"certName":null,"existingAddon":null,"addon":null,"sourceURI":{"spec":"https://addons.mozilla.org/mobile/downloads/file/126990/clear_mobile_history-1.0.2-fn-android.xpi?src=api","prePath":"https://addons.mozilla.org","scheme":"https","userPass":"","username":"","password":"","hostPort":"addons.mozilla.org","host":"addons.mozilla.org","port":-1,"path":"/mobile/downloads/file/126990/clear_mobile_history-1.0.2-fn-android.xpi?src=api","asciiSpec":"https://addons.mozilla.org/mobile/downloads/file/126990/clear_mobile_history-1.0.2-fn-android.xpi?src=api","asciiHost":"addons.mozilla.org","originCharset":"UTF-8","ref":""},"linkedInstalls":null}}],"addonCount":2,"totalResults":-1} diff --git a/mobile/android/base/AboutHomeContent.java b/mobile/android/base/AboutHomeContent.java new file mode 100644 index 00000000000..4a0aa2230c2 --- /dev/null +++ b/mobile/android/base/AboutHomeContent.java @@ -0,0 +1,273 @@ +/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*- + * ***** BEGIN LICENSE BLOCK ***** + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Mozilla Android code. + * + * The Initial Developer of the Original Code is Mozilla Foundation. + * Portions created by the Initial Developer are Copyright (C) 2011 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): + * Brad Lassey + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 2 or later (the "GPL"), or + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), + * in which case the provisions of the GPL or the LGPL are applicable instead + * of those above. If you wish to allow use of your version of this file only + * under the terms of either the GPL or the LGPL, and not to allow others to + * use your version of this file under the terms of the MPL, indicate your + * decision by deleting the provisions above and replace them with the notice + * and other provisions required by the GPL or the LGPL. If you do not delete + * the provisions above, a recipient may use your version of this file under + * the terms of any one of the MPL, the GPL or the LGPL. + * + * ***** END LICENSE BLOCK ***** */ + +package org.mozilla.gecko; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.*; +import android.database.*; +import android.view.*; +import android.graphics.*; +import android.content.*; +import android.provider.Browser; +import android.util.Log; +import java.util.Date; +import android.content.Intent; +import android.database.Cursor; +import android.net.Uri; +import android.os.Bundle; +import android.provider.Browser; +import android.util.Log; +import android.view.View; +import android.widget.ListAdapter; +import android.widget.GridView; +import android.widget.SimpleCursorAdapter; +import java.io.*; +import java.util.zip.*; +import android.os.Handler; +import org.json.*; +import android.util.AttributeSet; + +public class AboutHomeContent extends LinearLayout { + public interface UriLoadCallback { + public void callback(String uriSpec); + } + + UriLoadCallback mUriLoadCallback = null; + + void setUriLoadCallback(UriLoadCallback uriLoadCallback) { + mUriLoadCallback = uriLoadCallback; + } + + public AboutHomeContent(Context context, AttributeSet attrs) { + super(context, attrs); + } + private static final String LOGTAG = "GeckoAboutHome"; + private static final String TITLE_KEY = "title"; + private static final String kAbouthomeWhereClause = Browser.BookmarkColumns.BOOKMARK + " = 1"; + private static final int kTileWidth = 122; + + private Cursor mCursor; + private Uri mUri; + private String mTitle; + + protected ListAdapter mGridAdapter; + protected ArrayAdapter mAddonAdapter; + protected GridView mGrid; + protected ListView mAddonList; + private Handler mHandler = new Handler(); + + public void onActivityContentChanged(Activity activity) { + mGrid = (GridView)findViewById(R.id.grid); + if (mGrid == null) + return; + + mGrid.setOnItemClickListener(mGridOnClickListener); + + // we want to do this: mGrid.setNumColumns(GridView.AUTO_FIT); but it doesn't work + Display display = ((WindowManager) activity.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); + int width = display.getWidth(); + mGrid.setNumColumns((int) Math.floor(width / kTileWidth)); + mAddonList = (ListView)findViewById(R.id.recommended_addon_list); + GeckoApp.mAppContext.mMainHandler.post(new Runnable() { + public void run() { + mGrid.setAdapter(mGridAdapter); + } + }); + } + + + private AdapterView.OnItemClickListener mGridOnClickListener = new AdapterView.OnItemClickListener() { + public void onItemClick(AdapterView parent, View v, int position, long id) + { + onGridItemClick((GridView)parent, v, position, id); + } + }; + + void init(final Activity activity) { + LayoutInflater inflater = + (LayoutInflater) activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); + + inflater.inflate(R.layout.abouthome_content, this); + + GeckoAppShell.getHandler().post(new Runnable() { + public void run() { + mCursor = activity.managedQuery(Browser.BOOKMARKS_URI, + null, kAbouthomeWhereClause, null, null); + activity.startManagingCursor(mCursor); + + onActivityContentChanged(activity); + mAddonAdapter = new ArrayAdapter(activity, R.layout.abouthome_addon_list_item); + GeckoApp.mAppContext.mMainHandler.post(new Runnable() { + public void run() { + final SimpleCursorAdapter gridAdapter = + new SimpleCursorAdapter(activity, R.layout.abouthome_grid_box, mCursor, + new String[] {Browser.BookmarkColumns.TITLE, + Browser.BookmarkColumns.FAVICON, + Browser.BookmarkColumns.URL, + "thumbnail"}, + new int[] {R.id.bookmark_title, R.id.bookmark_icon, R.id.bookmark_url, R.id.screenshot}); + mGrid.setAdapter(gridAdapter); + gridAdapter.setViewBinder(new AwesomeCursorViewBinder()); + mAddonList.setAdapter(mAddonAdapter); + } + }); + readRecommendedAddons(activity); + } + }); + } + + void readRecommendedAddons(final Activity activity) { + GeckoAppShell.getHandler().post(new Runnable() { + public void run() { + try { + File applicationPackage = new File(activity.getApplication().getPackageResourcePath()); + byte[] buf = new byte[32768]; + ZipFile zip = new ZipFile(applicationPackage); + ZipEntry fileEntry = zip.getEntry("recommended-addons.json"); + + InputStream fileStream; + fileStream = zip.getInputStream(fileEntry); + StringBuffer jsonString = new StringBuffer(); + int read = 0; + while ((read = fileStream.read(buf, 0, 32768)) != -1) { + jsonString.append(new String(buf, 0, read)); + } + final JSONArray array = new JSONObject(jsonString.toString()).getJSONArray("addons"); + GeckoApp.mAppContext.mMainHandler.post(new Runnable() { + public void run() { + try { + for (int i = 0; i < array.length(); i++) { + JSONObject jsonobj = array.getJSONObject(i); + mAddonAdapter.add(jsonobj.getString("name")); + Log.i("GeckoAddons", "addon #" + i +": " + jsonobj.getString("name")); + } + } catch (Exception e) { + Log.i("GeckoAddons", "error reading json file", e); + } + } + }); + } catch (Exception e) { + Log.i("GeckoAddons", "error reading json file", e); + } + } + }); + } + + protected void onGridItemClick(GridView l, View v, int position, long id) { + mCursor.moveToPosition(position); + String spec = mCursor.getString(mCursor.getColumnIndex(Browser.BookmarkColumns.URL)); + Log.i(LOGTAG, "clicked: " + spec); + if (mUriLoadCallback != null) + mUriLoadCallback.callback(spec); + } + +} +class AwesomeCursorViewBinder implements SimpleCursorAdapter.ViewBinder { + private boolean updateImage(View view, Cursor cursor, int faviconIndex) { + byte[] b = cursor.getBlob(faviconIndex); + ImageView favicon = (ImageView) view; + + if (b == null) { + favicon.setImageResource(R.drawable.favicon); + } else { + Bitmap bitmap = BitmapFactory.decodeByteArray(b, 0, b.length); + favicon.setImageBitmap(bitmap); + } + + return true; + } + + private boolean updateTitle(View view, Cursor cursor, int titleIndex) { + String title = cursor.getString(titleIndex); + TextView titleView = (TextView)view; + // Use the URL instead of an empty title for consistency with the normal URL + // bar view - this is the equivalent of getDisplayTitle() in Tab.java + if (title == null || title.length() == 0) { + int urlIndex = cursor.getColumnIndexOrThrow(Browser.BookmarkColumns.URL); + title = cursor.getString(urlIndex); + } + + titleView.setText(title); + return true; + } + + private boolean updateUrl(View view, Cursor cursor, int urlIndex) { + String title = cursor.getString(urlIndex); + TextView urlView = (TextView)view; + if (title != null) { + int index; + if ((index = title.indexOf("://")) != -1) + title = title.substring(index + 3); + if (title.startsWith("www.")) + title = title.substring(4); + if (title.endsWith("/")) + title = title.substring(0, title.length() -1); + } + urlView.setText(title); + return true; + } + + @Override + public boolean setViewValue(View view, Cursor cursor, int columnIndex) { + int faviconIndex = cursor.getColumnIndexOrThrow(Browser.BookmarkColumns.FAVICON); + if (columnIndex == faviconIndex) { + return updateImage(view, cursor, faviconIndex); + } + + int titleIndex = cursor.getColumnIndexOrThrow(Browser.BookmarkColumns.TITLE); + if (columnIndex == titleIndex) { + return updateTitle(view, cursor, titleIndex); + } + + int urlIndex = cursor.getColumnIndexOrThrow(Browser.BookmarkColumns.URL); + if (columnIndex == urlIndex) { + return updateUrl(view, cursor, urlIndex); + } + + int thumbIndex = cursor.getColumnIndexOrThrow("thumbnail"); + + if (columnIndex == thumbIndex) { + return updateImage(view, cursor, thumbIndex); + } + + // Other columns are handled automatically + return false; + } + +} diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 414ccc5ec7b..9d3be399b56 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -122,6 +122,7 @@ abstract public class GeckoApp private static LayerController mLayerController; private static PlaceholderLayerClient mPlaceholderLayerClient; private static GeckoSoftwareLayerClient mSoftwareLayerClient; + AboutHomeContent mAboutHomeContent; boolean mUserDefinedProfile = false; private Vector mPluginViews = new Vector(); @@ -888,6 +889,8 @@ abstract public class GeckoApp mBrowserToolbar.setVisibility(View.VISIBLE); } }); + } else if (event.equals("AboutHome:Show")) { + showAboutHome(); } else if (event.equals("AgentMode:Changed")) { Tab.AgentMode agentMode = message.getString("agentMode").equals("mobile") ? Tab.AgentMode.MOBILE : Tab.AgentMode.DESKTOP; int tabId = message.getInt("tabId"); @@ -904,6 +907,40 @@ abstract public class GeckoApp } } + public void showAboutHome() { + Runnable r = new AboutHomeRunnable(true); + mMainHandler.postAtFrontOfQueue(r); + } + + public void hideAboutHome() { + Runnable r = new AboutHomeRunnable(false); + mMainHandler.postAtFrontOfQueue(r); + } + + public class AboutHomeRunnable implements Runnable { + boolean mShow; + AboutHomeRunnable(boolean show) { + mShow = show; + } + + public void run() { + if (mAboutHomeContent == null) { + mAboutHomeContent = new AboutHomeContent(GeckoApp.mAppContext, null); + mAboutHomeContent.init(GeckoApp.mAppContext); + mAboutHomeContent.setUriLoadCallback(new AboutHomeContent.UriLoadCallback() { + public void callback(String url) { + mBrowserToolbar.setProgressVisibility(true); + loadUrl(url, AwesomeBar.Type.EDIT); + } + }); + mGeckoLayout.addView(mAboutHomeContent); + } + if (mLayerController != null && mLayerController.getView() != null) + mLayerController.getView().setVisibility(mShow ? View.GONE : View.VISIBLE); + mAboutHomeContent.setVisibility(mShow ? View.VISIBLE : View.GONE); + } + } + void updateAgentModeMenuItem(final Tab tab, final Tab.AgentMode agentMode) { if (sMenu == null) return; @@ -985,10 +1022,16 @@ abstract public class GeckoApp } void handleSelectTab(int tabId) { + Tab selTab = Tabs.getInstance().getSelectedTab(); final Tab tab = Tabs.getInstance().selectTab(tabId); if (tab == null) return; + if (selTab.getURL().equals("about:home") && !tab.getURL().equals("about:home")) + hideAboutHome(); + else if (tab.getURL().equals("about:home")) + showAboutHome(); + updateAgentModeMenuItem(tab, tab.getAgentMode()); mMainHandler.post(new Runnable() { @@ -1328,6 +1371,7 @@ abstract public class GeckoApp GeckoAppShell.registerGeckoEventListener("ToggleChrome:Hide", GeckoApp.mAppContext); GeckoAppShell.registerGeckoEventListener("ToggleChrome:Show", GeckoApp.mAppContext); GeckoAppShell.registerGeckoEventListener("AgentMode:Changed", GeckoApp.mAppContext); + GeckoAppShell.registerGeckoEventListener("AboutHome:Show", GeckoApp.mAppContext); mConnectivityFilter = new IntentFilter(); mConnectivityFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); @@ -1543,6 +1587,16 @@ abstract public class GeckoApp unregisterReceiver(mBatteryReceiver); } + @Override + public void onContentChanged() { + super.onContentChanged(); + if (mAboutHomeContent == null) + return; + mAboutHomeContent = (AboutHomeContent) findViewById(R.id.abouthome_content); + mAboutHomeContent.onActivityContentChanged(this); + } + + @Override public void onConfigurationChanged(android.content.res.Configuration newConfig) { @@ -1860,6 +1914,7 @@ abstract public class GeckoApp } public void loadUrl(String url, AwesomeBar.Type type) { + hideAboutHome(); mBrowserToolbar.setTitle(url); Log.d(LOGTAG, type.name()); if (type == AwesomeBar.Type.ADD) { diff --git a/mobile/android/base/GeckoThread.java b/mobile/android/base/GeckoThread.java index b8a27913a92..901a72c96f7 100644 --- a/mobile/android/base/GeckoThread.java +++ b/mobile/android/base/GeckoThread.java @@ -62,6 +62,16 @@ public class GeckoThread extends Thread { public void run() { final GeckoApp app = GeckoApp.mAppContext; Intent intent = mIntent; + String uri = intent.getDataString(); + String title = uri; + if (!app.mUserDefinedProfile && (uri == null || uri.length() == 0)) { + SharedPreferences prefs = app.getSharedPreferences("GeckoApp", app.MODE_PRIVATE); + uri = prefs.getString("last-uri", ""); + title = prefs.getString("last-title", uri); + } + if (uri == null || uri.equals("") || uri.equals("about:home")) { + app.showAboutHome(); + } File cacheFile = GeckoAppShell.getCacheDir(); File libxulFile = new File(cacheFile, "libxul.so"); @@ -93,23 +103,14 @@ public class GeckoThread extends Thread { Log.w(LOGTAG, "zerdatime " + new Date().getTime() + " - runGecko"); // and then fire us up - try { - String uri = intent.getDataString(); - String title = uri; - if (!app.mUserDefinedProfile && - (uri == null || uri.length() == 0)) { - SharedPreferences prefs = app.getSharedPreferences("GeckoApp", app.MODE_PRIVATE); - uri = prefs.getString("last-uri", ""); - title = prefs.getString("last-title", uri); + + final String activityTitle = title; + app.mMainHandler.post(new Runnable() { + public void run() { + app.mBrowserToolbar.setTitle(activityTitle); } - - final String awesomeTitle = title; - app.mMainHandler.post(new Runnable() { - public void run() { - app.mBrowserToolbar.setTitle(awesomeTitle); - } - }); - + }); + try { Log.w(LOGTAG, "RunGecko - URI = " + uri); GeckoAppShell.runGecko(app.getApplication().getPackageResourcePath(), diff --git a/mobile/android/base/Makefile.in b/mobile/android/base/Makefile.in index b5d343d37f9..c14a41c2b34 100644 --- a/mobile/android/base/Makefile.in +++ b/mobile/android/base/Makefile.in @@ -48,6 +48,7 @@ DIRS = locales DIST_FILES = package-name.txt JAVAFILES = \ + AboutHomeContent.java \ AlertNotification.java \ AwesomeBar.java \ AwesomeBarTabs.java \ @@ -183,6 +184,8 @@ RES_LAYOUT = \ res/layout/tabs_tray.xml \ res/layout/list_item_header.xml \ res/layout/select_dialog_list.xml \ + res/layout/abouthome_content.xml \ + res/layout/abouthome_grid_box.xml \ $(NULL) RES_LAYOUT_V11 = \ @@ -378,6 +381,8 @@ MOZ_ANDROID_DRAWABLES += mobile/android/base/resources/drawable/address_bar_bg.x mobile/android/base/resources/drawable/tabs_tray_bg.9.png \ mobile/android/base/resources/drawable/checkerboard.png \ mobile/android/base/resources/drawable/shadow.png \ + mobile/android/base/resources/drawable/rounded_grey_border.xml \ + mobile/android/base/resources/drawable/rounded_grey_box.xml \ $(NULL) diff --git a/mobile/android/base/resources/drawable/rounded_grey_border.xml b/mobile/android/base/resources/drawable/rounded_grey_border.xml new file mode 100644 index 00000000000..c4ec322bf39 --- /dev/null +++ b/mobile/android/base/resources/drawable/rounded_grey_border.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/mobile/android/base/resources/drawable/rounded_grey_box.xml b/mobile/android/base/resources/drawable/rounded_grey_box.xml new file mode 100644 index 00000000000..ae0ea76a02f --- /dev/null +++ b/mobile/android/base/resources/drawable/rounded_grey_box.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/mobile/android/base/resources/layout/abouthome_content.xml b/mobile/android/base/resources/layout/abouthome_content.xml new file mode 100644 index 00000000000..c8055a996c6 --- /dev/null +++ b/mobile/android/base/resources/layout/abouthome_content.xml @@ -0,0 +1,43 @@ + + + + + + + + + + diff --git a/mobile/android/base/resources/layout/abouthome_grid_box.xml b/mobile/android/base/resources/layout/abouthome_grid_box.xml new file mode 100644 index 00000000000..17c4974c2f1 --- /dev/null +++ b/mobile/android/base/resources/layout/abouthome_grid_box.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + diff --git a/mobile/android/chrome/content/aboutHome.xhtml b/mobile/android/chrome/content/aboutHome.xhtml index c355e3d308d..f051b8fa490 100644 --- a/mobile/android/chrome/content/aboutHome.xhtml +++ b/mobile/android/chrome/content/aboutHome.xhtml @@ -4,12 +4,8 @@ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" [ %brandDTD; - -%globalDTD; %preferenceDTD; - -%aboutDTD; ]> -
- &aboutHome.openAllTabs; - &aboutHome.noTabs; - &aboutHome.noAddons; -
- - - - + +]]> diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index e19c8a4e04c..54e0dc88d0e 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -88,6 +88,7 @@ @BINPATH@/res/drawable @BINPATH@/res/drawable-hdpi @BINPATH@/res/layout +@BINPATH@/recommended-addons.json #endif #ifdef MOZ_PLATFORM_MAEMO diff --git a/mobile/android/locales/en-US/chrome/aboutHome.dtd b/mobile/android/locales/en-US/chrome/aboutHome.dtd deleted file mode 100644 index 55cfd046e63..00000000000 --- a/mobile/android/locales/en-US/chrome/aboutHome.dtd +++ /dev/null @@ -1,31 +0,0 @@ -&brandShortName; Start"> - - - - - - - - - - - - - - - - - - - - diff --git a/mobile/android/locales/jar.mn b/mobile/android/locales/jar.mn index 8146f06fc9a..3fd7029d0fc 100644 --- a/mobile/android/locales/jar.mn +++ b/mobile/android/locales/jar.mn @@ -6,7 +6,6 @@ locale/@AB_CD@/browser/aboutAddons.dtd (%chrome/aboutAddons.dtd) locale/@AB_CD@/browser/aboutAddons.properties (%chrome/aboutAddons.properties) locale/@AB_CD@/browser/aboutCertError.dtd (%chrome/aboutCertError.dtd) - locale/@AB_CD@/browser/aboutHome.dtd (%chrome/aboutHome.dtd) locale/@AB_CD@/browser/browser.dtd (%chrome/browser.dtd) locale/@AB_CD@/browser/browser.properties (%chrome/browser.properties) locale/@AB_CD@/browser/config.dtd (%chrome/config.dtd) diff --git a/mobile/android/themes/core/aboutHome.css b/mobile/android/themes/core/aboutHome.css deleted file mode 100644 index 8156d1600f5..00000000000 --- a/mobile/android/themes/core/aboutHome.css +++ /dev/null @@ -1,413 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is Mozilla Mobile Browser. - * - * The Initial Developer of the Original Code is - * Mozilla Corporation. - * Portions created by the Initial Developer are Copyright (C) 2008 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Mark Finkle - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -html { - background: white; - font-family: "Nokia Sans", Tahoma, sans-serif !important; - font-size: 24px; - margin: 0px 20px; -} - -#wrapper { - max-width: 600px; - margin: 0 auto; -} - -#logo { - float: right; - margin-top: -24px; - -moz-margin-end: -34px; - /* Trick to ensure this is shown above the opacity transform happening to content*/ - -moz-transform: translate(0,0); -} - -body[dir="rtl"] #logo { - float: left; -} - -#header { - font-weight: bold; - color: white; - background: transparent -moz-linear-gradient(top, rgba(57,89,117,1) 0%, rgba(30,66,98,1) 50%, rgba(24,54,82,1) 90%); - border-radius: 6px; - padding: 12px; - padding-bottom: 14px; - margin-bottom: 12px; - margin-top: 20px; - box-shadow: inset rgba(0, 0, 0, 0.2) 0 -3px 0px, rgba(0, 0, 0, 0.1) 0px 2px 0px; -} - -#header-suffix { - color: rgb(112,136,156); -} - -.section-box { - background-color: white; - padding: 0; - margin-bottom: 8px; - border-radius: 8px; - border: 1px solid rgba(0,0,0,0.3); - box-shadow: - inset rgba(255, 255, 255, 0.5) 0 1px 0px, - inset rgba(0, 0, 0, 0.1) 0 -3px 0px, - rgba(0, 0, 0, 0.1) 0px 2px 0px; - width: 100%; - overflow: hidden; -} - -.section-box > h1 { - font-size: 18px; - font-weight: normal; - color: black; - background: transparent -moz-linear-gradient(top, rgba(235,235,235,0.2) 0%, rgba(235,235,235,1) 90%); - margin: 0; - padding: 4px 12px 8px 12px; - border-radius: 8px 8px 0 0; -} - -.section-box > div, -.section-box > a { - border-bottom: 1px solid rgba(0,0,0,0.1); - padding: 8px; - padding-bottom: 12px; - position: relative; -} - -.section-box > a { - display: block; - text-decoration: none; -} - -.section-box > div:last-child, -.section-box > a:last-child { - border-bottom: 0; -} - -/* Make room for the image */ -.section-box > div > div, -.section-box > a > div, -.section-row > div > div { - -moz-margin-start: 48px; -} - -.section-box .title { - color: black; -} - -.section-box .openall { - font-size: 18px; - padding: 12px 8px; - color: black; -} - -body[dir="ltr"] .section-box .openall { - text-align: right; -} - -.section-box .version { - /* The addon title is not localized, so keep the margin on the left side */ - margin-left: 12px; - font-size: 18px; - color: gray; -} - -.section-box .inner { - pointer-events: none; -} - -.section-box .favicon { - border: none; - top: 8px; - width: 32px; - height: 32px; - position: absolute; - pointer-events: none; -} - -body[dir="ltr"] .section-box .favicon { - left: 12px; -} - -body[dir="ltr"] .section-box .favicon { - right: 12px; -} - -body[dir="ltr"] #newAddons > div:not(.loading) { - background: url("images/arrowright-16.png") 99% center no-repeat; -} - -body[dir="rtl"] #newAddons > div:not(.loading) { - background: url("images/arrowleft-16.png") 1% center no-repeat; -} - -#remoteTabs[disabled=true] { - pointer-events: none; - color: #aaa; -} - -#remoteTabs[disabled=true] > div > .favicon { - opacity: 0.5; -} - -.section-row { - color: black; - background: transparent -moz-linear-gradient(top, rgba(235,235,235,0.2) 0%, rgba(235,235,235,1) 90%); - padding: 8px; - padding-bottom: 12px; - border-radius: 8px; - border: 1px solid rgba(0,0,0,0.3); - box-shadow: - inset rgba(255, 255, 255, 0.5) 0 1px 0px, - inset rgba(0, 0, 0, 0.1) 0 -3px 0px, - rgba(0, 0, 0, 0.1) 0px 2px 0px; - margin: 24px auto; -} - -.section-row > div { - position: relative; - pointer-events: none; -} - -.section-row .favicon { - border: none; - top: 0; - width: 32px; - height: 32px; - position: absolute; -} - -#newAddons { - margin-bottom: 0; -} - -/* Make sure the button and list match up nicely */ -#newAddons[showlist] { - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; - box-shadow: none; - margin: 0 -2px 0 0; -} - -#newAddonsList { - border-top-left-radius: 0; - border-top-right-radius: 0; -} - -body[dir="ltr"] { - left: 4px; -} - -body[dir="rtl"] { - right: 4px; -} - -.loading > img { - display: block; - margin: 0 auto; -} - -.no-items { - text-align: center; - -moz-margin-start: 0 !important; -} - -#footer-wrapper { - font-size: 18px; - margin-top: 24px; - text-align: center; -} - -#feedback { - display: inline-block; - margin: 0; -} - -#support { - display: inline-block; - margin: 0; -} - -#sync-setup { - font-size: 18px; - margin-top: 24px; - text-align: center; -} - -#syncSetupSync, -#syncPairDevice { - text-decoration: underline; - color: blue; -} - -/* Lightbox for Aurora */ -#lightbox { - position: fixed; - width: 100%; - height: 100%; - top: 0px; - left: 0px; - display: none; -} - -#lightbox-background { - background-color: #000; - width: 100%; - height: 100%; - opacity: 0.4; -} - -#lightbox-wrapper { - background: transparent; - width: 100%; - height: 100%; - top: 0px; - left: 0px; - position: fixed; -} - -#lightbox-container { - max-width: 300px; - margin: 40px auto; - background: #000 url("images/aurora-lightbox-bg.jpg") center top no-repeat; - border-radius: 6px; - padding: 26px 0px 0px; - border: 1px solid #000; - box-shadow: rgba(0, 0, 0, 0.75) 0px 0px 10px 2px; - position: relative; -} - -#lightbox-logo { - width: 65%; - max-width: 195px; - display: block; - margin: 0px auto; -} - -#lightbox-message { - width: 100%; - padding: 34px 0px 18px; - text-align: center; -} - -#lightbox-message > p, -#lightbox-button > p { - font-family: Georgia; - margin: 0px; - padding: 0px; -} - -#lightbox-message > p.title , -#lightbox-button > p.title { - font-size: 24px; - line-height: 24px; - color: #fff; - padding-bottom: 10px; -} - -#lightbox-message > p.message, -#lightbox-button > p.sub-title { - font-size: 16px; - line-height: 20px; -} - -#lightbox-message > p.message { - color: #c0b5b5; -} - -#lightbox-container a, -#lightbox-container a:hover, -#lightbox-container a:visited { - outline: 0px; - border: 0px; - text-decoration: none; - display: block; -} - -#lightbox-button { - background: -moz-linear-gradient(center top , #84C63C 0%, #489615 100%) repeat scroll 0 0 transparent; - margin: 10px; - text-align: center; - border-radius: 4px; - padding: 18px 0px; - box-shadow: rgba(0, 0, 0, 0) 0px 0px, inset rgba(0, 0, 0, 0.1) 0px -3px; -} - -#lightbox-button > p.title, -#lightbox-button > p.sub-title { - text-shadow: rgba(136, 136, 136, 0.39) 0px 0px 0px -1px; -} - -#lightbox-button > p.sub-title { - font-style: italic; - color: #fff; -} - -#lightbox-close { - position: absolute; - top: 15px; - right: 15px; - width: 16px; - height: 16px; -} - -@media (max-width: 399px) { - #support { - margin-top: 8px; - } -} - -@media (min-width: 400px) { - body[dir="ltr"] #feedback { - border-radius: 8px 0 0 8px; - } - - body[dir="rtl"] #feedback { - border-radius: 0 8px 8px 0; - } - - #support { - -moz-border-start: none; - } - - body[dir="ltr"] #support { - border-radius: 0 8px 8px 0; - } - - body[dir="rtl"] #support { - border-radius: 8px 0 0 8px; - } -} diff --git a/mobile/android/themes/core/jar.mn b/mobile/android/themes/core/jar.mn index 7e3bf5537ce..7b96c87866d 100644 --- a/mobile/android/themes/core/jar.mn +++ b/mobile/android/themes/core/jar.mn @@ -9,7 +9,6 @@ chrome.jar: skin/aboutPage.css (aboutPage.css) skin/about.css (about.css) skin/aboutAddons.css (aboutAddons.css) - skin/aboutHome.css (aboutHome.css) * skin/browser.css (browser.css) * skin/content.css (content.css) skin/config.css (config.css) @@ -90,7 +89,6 @@ chrome.jar: skin/gingerbread/aboutPage.css (aboutPage.css) skin/gingerbread/about.css (about.css) skin/gingerbread/aboutAddons.css (aboutAddons.css) - skin/gingerbread/aboutHome.css (aboutHome.css) * skin/gingerbread/browser.css (gingerbread/browser.css) * skin/gingerbread/content.css (gingerbread/content.css) skin/gingerbread/config.css (config.css) @@ -168,7 +166,6 @@ chrome.jar: skin/honeycomb/aboutPage.css (aboutPage.css) skin/honeycomb/about.css (about.css) skin/honeycomb/aboutAddons.css (aboutAddons.css) - skin/honeycomb/aboutHome.css (aboutHome.css) * skin/honeycomb/browser.css (honeycomb/browser.css) * skin/honeycomb/content.css (content.css) skin/honeycomb/config.css (config.css) diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk index 4b731ff2314..77a5eee4bc0 100644 --- a/toolkit/mozapps/installer/packager.mk +++ b/toolkit/mozapps/installer/packager.mk @@ -298,6 +298,7 @@ DIST_FILES = \ chrome.manifest \ update.locale \ removed-files \ + recommended-addons.json \ $(NULL) NON_DIST_FILES = \