Always offer to restore

 Always offer to restore (even across reboots)
 Periodically save while the user is typing in a textfield

Change-Id: If226ea7d2e19c58d8205d663f9f8dd670c712436
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java
index 986b617..5fb413b 100644
--- a/src/com/android/browser/Controller.java
+++ b/src/com/android/browser/Controller.java
@@ -226,7 +226,7 @@
         mDataController = DataController.getInstance(mActivity);
         mTabControl = new TabControl(this);
         mSettings.setController(this);
-        mCrashRecoveryHandler = new CrashRecoveryHandler(this);
+        mCrashRecoveryHandler = CrashRecoveryHandler.initialize(this);
 
         mUrlHandler = new UrlHandler(this);
         mIntentHandler = new IntentHandler(mActivity, this);
@@ -262,7 +262,6 @@
     void start(final Bundle icicle, final Intent intent) {
         boolean noCrashRecovery = intent.getBooleanExtra(NO_CRASH_RECOVERY, false);
         if (icicle != null || noCrashRecovery) {
-            mCrashRecoveryHandler.clearState();
             doStart(icicle, intent);
         } else {
             mCrashRecoveryHandler.startRecovery(intent);
@@ -615,7 +614,7 @@
         mNetworkHandler.onPause();
 
         WebView.disablePlatformNotifications();
-        mCrashRecoveryHandler.clearState();
+        mCrashRecoveryHandler.backupState();
     }
 
     void onSaveInstanceState(Bundle outState, boolean saveImages) {
@@ -2141,6 +2140,7 @@
     protected void removeTab(Tab tab) {
         mUi.removeTab(tab);
         mTabControl.removeTab(tab);
+        mCrashRecoveryHandler.backupState();
     }
 
     @Override