blob: 32cee670087cfcd4228e68efed0485bfd070bd05 [file] [log] [blame]
The Android Open Source Projectba6d7b82008-10-21 07:00:00 -07001/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.browser;
18
19import android.util.Config;
20import android.util.Log;
21
22import android.app.Application;
23import android.content.Intent;
24import android.webkit.CookieManager;
25import android.webkit.CookieSyncManager;
26
27import dalvik.system.VMRuntime;
28
29public class Browser extends Application {
30
31 private final static String LOGTAG = "browser";
32
33 /**
34 * Specifies a heap utilization ratio that works better
35 * for the browser than the default ratio does.
36 */
37 private final static float TARGET_HEAP_UTILIZATION = 0.75f;
38
39 public Browser() {
40 }
41
42 public void onCreate() {
43 if (Config.LOGV)
44 Log.v(LOGTAG, "Browser.onCreate: this=" + this);
45 // Fix heap utilization for better heap size characteristics.
46 VMRuntime.getRuntime().setTargetHeapUtilization(
47 TARGET_HEAP_UTILIZATION);
48 // create CookieSyncManager with current Context
49 CookieSyncManager.createInstance(this);
50 // remove all expired cookies
51 CookieManager.getInstance().removeExpiredCookie();
52 }
53
54 static Intent createBrowserViewIntent() {
55 Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
56 return intent;
57 }
58}
59