summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-09-06 16:54:34 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-06 16:54:34 -0700
commit9754b4311b58e24899b9c5c09a3a760a0fd9db81 (patch)
treeb628546251351b0490cdab068700449347b2e5ee /src
parent534dfa4b8aeae881a24b3d5dfa6927f15bb37b29 (diff)
parenta60fffaa18e26b29880c7ce21548af4f8ec0e443 (diff)
downloadpackages_apps_Browser-9754b4311b58e24899b9c5c09a3a760a0fd9db81.zip
packages_apps_Browser-9754b4311b58e24899b9c5c09a3a760a0fd9db81.tar.gz
packages_apps_Browser-9754b4311b58e24899b9c5c09a3a760a0fd9db81.tar.bz2
Merge "Monkey protection"
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/Controller.java10
-rw-r--r--src/com/android/browser/NavigationBarTablet.java6
2 files changed, 13 insertions, 3 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 67c42dd..b7cdcd4 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -1535,7 +1535,10 @@ public class Controller
break;
case R.id.add_bookmark_menu_id:
- mActivity.startActivity(createBookmarkCurrentPageIntent(false));
+ Intent bookmarkIntent = createBookmarkCurrentPageIntent(false);
+ if (bookmarkIntent != null) {
+ mActivity.startActivity(bookmarkIntent);
+ }
break;
case R.id.stop_reload_menu_id:
@@ -1856,9 +1859,12 @@ public class Controller
*/
@Override
public Intent createBookmarkCurrentPageIntent(boolean editExisting) {
+ WebView w = getCurrentTopWebView();
+ if (w == null) {
+ return null;
+ }
Intent i = new Intent(mActivity,
AddBookmarkPage.class);
- WebView w = getCurrentTopWebView();
i.putExtra(BrowserContract.Bookmarks.URL, w.getUrl());
i.putExtra(BrowserContract.Bookmarks.TITLE, w.getTitle());
String touchIconUrl = w.getTouchIconUrl();
diff --git a/src/com/android/browser/NavigationBarTablet.java b/src/com/android/browser/NavigationBarTablet.java
index 8c08dcf..661ed71 100644
--- a/src/com/android/browser/NavigationBarTablet.java
+++ b/src/com/android/browser/NavigationBarTablet.java
@@ -20,6 +20,7 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.Context;
+import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.Bitmap;
@@ -161,7 +162,10 @@ public class NavigationBarTablet extends NavigationBarBase {
} else if (mForwardButton == v) {
mUiController.getCurrentTab().goForward();
} else if (mStar == v) {
- getContext().startActivity(mUiController.createBookmarkCurrentPageIntent(true));
+ Intent intent = mUiController.createBookmarkCurrentPageIntent(true);
+ if (intent != null) {
+ getContext().startActivity(intent);
+ }
} else if (mAllButton == v) {
mUiController.bookmarksOrHistoryPicker(false);
} else if (mSearchButton == v) {