diff options
| author | Nicolas Roard <nicolasroard@google.com> | 2009-05-11 13:34:17 +0100 |
|---|---|---|
| committer | Nicolas Roard <nicolasroard@google.com> | 2009-05-11 15:21:18 +0100 |
| commit | 78a98e459323f938e97789a6131beddbebb459ce (patch) | |
| tree | 33c27f05be9380b2d5f292aef2ea0f3db910da86 /src/com/android/browser/BrowserActivity.java | |
| parent | 11b90900d0d27e5e288b01c6dbdfb893f1cc1eea (diff) | |
Add UI support in the browser for HTML5 databases
Diffstat (limited to 'src/com/android/browser/BrowserActivity.java')
| -rw-r--r-- | src/com/android/browser/BrowserActivity.java | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index af65072e..c24577cf 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -163,6 +163,8 @@ public class BrowserActivity extends Activity private SensorManager mSensorManager = null; + private WebStorage.QuotaUpdater mWebStorageQuotaUpdater = null; + /* Whitelisted webpages private static HashSet<String> sWhiteList; @@ -3456,9 +3458,14 @@ public class BrowserActivity extends Activity + currentQuota + ")"); } - // Give the origin an extra megabyte to play with. - // TODO: This should show a prompt to the user, really :) - quotaUpdater.updateQuota(currentQuota + 1024 * 1024); + mWebStorageQuotaUpdater = quotaUpdater; + String DIALOG_PACKAGE = "com.android.browser"; + String DIALOG_CLASS = DIALOG_PACKAGE + ".PermissionDialog"; + Intent intent = new Intent(); + intent.setClassName(DIALOG_PACKAGE, DIALOG_CLASS); + intent.putExtra(PermissionDialog.PARAM_ORIGIN, url); + intent.putExtra(PermissionDialog.PARAM_QUOTA, currentQuota); + startActivityForResult(intent, WEBSTORAGE_QUOTA_DIALOG); } }; @@ -4165,6 +4172,14 @@ public class BrowserActivity extends Activity } } break; + case WEBSTORAGE_QUOTA_DIALOG: + long currentQuota = 0; + if (resultCode == RESULT_OK && intent != null) { + currentQuota = intent.getLongExtra( + PermissionDialog.PARAM_QUOTA, currentQuota); + } + mWebStorageQuotaUpdater.updateQuota(currentQuota); + break; default: break; } @@ -4721,9 +4736,10 @@ public class BrowserActivity extends Activity private BroadcastReceiver mNetworkStateIntentReceiver; // activity requestCode - final static int COMBO_PAGE = 1; - final static int DOWNLOAD_PAGE = 2; - final static int PREFERENCES_PAGE = 3; + final static int COMBO_PAGE = 1; + final static int DOWNLOAD_PAGE = 2; + final static int PREFERENCES_PAGE = 3; + final static int WEBSTORAGE_QUOTA_DIALOG = 4; // the frenquency of checking whether system memory is low final static int CHECK_MEMORY_INTERVAL = 30000; // 30 seconds |
