PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/WebVox/src/com/marvin/webvox/Browser.java

http://eyes-free.googlecode.com/
Java | 67 lines | 28 code | 14 blank | 25 comment | 1 complexity | 0e5cb835e92bd4a4483467e03da27b9d MD5 | raw file
 1/*
 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.marvin.webvox;
18
19import android.util.Log;
20
21import android.app.Application;
22import android.content.Intent;
23import android.webkit.CookieManager;
24import android.webkit.CookieSyncManager;
25
26import dalvik.system.VMRuntime;
27
28public class Browser extends Application { 
29
30    private final static String LOGTAG = "browser";
31
32    // Set to true to enable extra debugging.
33    final static boolean DEBUG = false;
34    
35    // Set to true to enable verbose logging.
36    final static boolean LOGV_ENABLED = DEBUG;
37
38    // Set to true to enable extra debug logging.
39    final static boolean LOGD_ENABLED = true;
40
41    /**
42     * Specifies a heap utilization ratio that works better
43     * for the browser than the default ratio does.
44     */
45    private final static float TARGET_HEAP_UTILIZATION = 0.75f;
46
47    public Browser() {
48    }
49
50    public void onCreate() {
51        if (LOGV_ENABLED)
52            Log.v(LOGTAG, "Browser.onCreate: this=" + this);
53        // Fix heap utilization for better heap size characteristics.
54        VMRuntime.getRuntime().setTargetHeapUtilization(
55                TARGET_HEAP_UTILIZATION);
56        // create CookieSyncManager with current Context
57        CookieSyncManager.createInstance(this);
58        // remove all expired cookies
59        CookieManager.getInstance().removeExpiredCookie();
60    }
61
62    static Intent createBrowserViewIntent() {
63        Intent intent = new Intent(Intent.ACTION_WEB_SEARCH);
64        return intent;
65    }
66}
67