summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/BaseUi.java14
-rw-r--r--src/com/android/browser/Browser.java3
-rwxr-xr-xsrc/com/android/browser/GeolocationPermissionsPrompt.java35
-rw-r--r--src/com/android/browser/NfcHandler.java3
-rw-r--r--src/com/android/browser/Tab.java1
5 files changed, 24 insertions, 32 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index 1836e6e26..e577b1b6b 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -88,7 +88,6 @@ public abstract class BaseUi implements UI, OnTouchListener {
private Drawable mMixLockIcon;
protected Drawable mGenericFavicon;
- private FrameLayout mBrowserFrameLayout;
protected FrameLayout mContentView;
protected FrameLayout mCustomViewContainer;
@@ -125,15 +124,14 @@ public abstract class BaseUi implements UI, OnTouchListener {
FrameLayout frameLayout = (FrameLayout) mActivity.getWindow()
.getDecorView().findViewById(android.R.id.content);
- mBrowserFrameLayout = (FrameLayout) LayoutInflater.from(mActivity)
- .inflate(R.layout.custom_screen, null);
- mContentView = (FrameLayout) mBrowserFrameLayout.findViewById(
+ LayoutInflater.from(mActivity)
+ .inflate(R.layout.custom_screen, frameLayout);
+ mContentView = (FrameLayout) frameLayout.findViewById(
R.id.main_content);
- mErrorConsoleContainer = (LinearLayout) mBrowserFrameLayout
+ mErrorConsoleContainer = (LinearLayout) frameLayout
.findViewById(R.id.error_console);
- mCustomViewContainer = (FrameLayout) mBrowserFrameLayout
+ mCustomViewContainer = (FrameLayout) frameLayout
.findViewById(R.id.fullscreen_custom_content);
- frameLayout.addView(mBrowserFrameLayout, COVER_SCREEN_PARAMS);
setFullscreen(BrowserSettings.getInstance().useFullscreen());
mGenericFavicon = res.getDrawable(
R.drawable.app_web_browser_sm);
@@ -349,7 +347,7 @@ public abstract class BaseUi implements UI, OnTouchListener {
// The tab consists of a container view, which contains the main
// WebView, as well as any other UI elements associated with the tab.
container = mActivity.getLayoutInflater().inflate(R.layout.tab,
- null);
+ mContentView, false);
tab.setViewContainer(container);
}
if (tab.getWebView() != webView) {
diff --git a/src/com/android/browser/Browser.java b/src/com/android/browser/Browser.java
index 909a50d73..c4412e203 100644
--- a/src/com/android/browser/Browser.java
+++ b/src/com/android/browser/Browser.java
@@ -18,6 +18,7 @@ package com.android.browser;
import android.app.Application;
import android.content.Intent;
+import android.os.AsyncTask;
import android.util.Log;
import android.webkit.CookieSyncManager;
@@ -52,6 +53,8 @@ public class Browser extends Application {
if (LOGV_ENABLED)
Log.v(LOGTAG, "Browser.onCreate: this=" + this);
+ // Fix AsyncTask to use multiple threads
+ AsyncTask.setDefaultExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
// Fix heap utilization for better heap size characteristics.
VMRuntime.getRuntime().setTargetHeapUtilization(
TARGET_HEAP_UTILIZATION);
diff --git a/src/com/android/browser/GeolocationPermissionsPrompt.java b/src/com/android/browser/GeolocationPermissionsPrompt.java
index 95c541543..afbf39f04 100755
--- a/src/com/android/browser/GeolocationPermissionsPrompt.java
+++ b/src/com/android/browser/GeolocationPermissionsPrompt.java
@@ -17,22 +17,18 @@
package com.android.browser;
import android.content.Context;
-import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.AttributeSet;
import android.view.Gravity;
-import android.view.LayoutInflater;
import android.view.View;
-import android.webkit.WebView;
import android.webkit.GeolocationPermissions;
import android.widget.Button;
import android.widget.CheckBox;
-import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
-public class GeolocationPermissionsPrompt extends LinearLayout {
- private LinearLayout mInner;
+public class GeolocationPermissionsPrompt extends RelativeLayout {
private TextView mMessage;
private Button mShareButton;
private Button mDontShareButton;
@@ -48,22 +44,26 @@ public class GeolocationPermissionsPrompt extends LinearLayout {
super(context, attrs);
}
- void init() {
- mInner = (LinearLayout) findViewById(R.id.inner);
+ @Override
+ protected void onFinishInflate() {
+ super.onFinishInflate();
+ init();
+ }
+
+ private void init() {
mMessage = (TextView) findViewById(R.id.message);
mShareButton = (Button) findViewById(R.id.share_button);
mDontShareButton = (Button) findViewById(R.id.dont_share_button);
mRemember = (CheckBox) findViewById(R.id.remember);
- final GeolocationPermissionsPrompt me = this;
mShareButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
- me.handleButtonClick(true);
+ handleButtonClick(true);
}
});
mDontShareButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
- me.handleButtonClick(false);
+ handleButtonClick(false);
}
});
}
@@ -79,21 +79,21 @@ public class GeolocationPermissionsPrompt extends LinearLayout {
setMessage("http".equals(uri.getScheme()) ? mOrigin.substring(7) : mOrigin);
// The checkbox should always be intially checked.
mRemember.setChecked(true);
- showDialog(true);
+ setVisibility(View.VISIBLE);
}
/**
* Hides the prompt.
*/
public void hide() {
- showDialog(false);
+ setVisibility(View.GONE);
}
/**
* Handles a click on one the buttons by invoking the callback.
*/
private void handleButtonClick(boolean allow) {
- showDialog(false);
+ hide();
boolean remember = mRemember.isChecked();
if (remember) {
@@ -117,11 +117,4 @@ public class GeolocationPermissionsPrompt extends LinearLayout {
getResources().getString(R.string.geolocation_permissions_prompt_message),
origin));
}
-
- /**
- * Shows or hides the prompt.
- */
- private void showDialog(boolean shown) {
- mInner.setVisibility(shown ? View.VISIBLE : View.GONE);
- }
}
diff --git a/src/com/android/browser/NfcHandler.java b/src/com/android/browser/NfcHandler.java
index bdfe25ef7..bbac640a0 100644
--- a/src/com/android/browser/NfcHandler.java
+++ b/src/com/android/browser/NfcHandler.java
@@ -58,8 +58,7 @@ public class NfcHandler implements NfcAdapter.NdefPushCallback {
String currentUrl = currentTab.getUrl();
if (currentUrl != null && currentTab.getWebView() != null &&
!currentTab.getWebView().isPrivateBrowsingEnabled()) {
- NdefRecord record = new NdefRecord(NdefRecord.TNF_ABSOLUTE_URI,
- NdefRecord.RTD_URI, new byte[] {}, currentUrl.getBytes());
+ NdefRecord record = NdefRecord.createUri(currentUrl);
NdefMessage msg = new NdefMessage(new NdefRecord[] { record });
return msg;
} else {
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index f8687a89d..334bd9d13 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -1663,7 +1663,6 @@ class Tab {
.findViewById(R.id.geolocation_permissions_prompt);
mGeolocationPermissionsPrompt = (GeolocationPermissionsPrompt) stub
.inflate();
- mGeolocationPermissionsPrompt.init();
}
return mGeolocationPermissionsPrompt;
}