/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.browser; import com.android.browser.Tab.LockIcon; import com.android.internal.view.menu.MenuBuilder; import android.animation.ObjectAnimator; import android.app.Activity; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.content.res.Resources; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.text.TextUtils; import android.util.Log; import android.view.Gravity; import android.view.LayoutInflater; import android.view.Menu; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewGroup.LayoutParams; import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import android.webkit.WebChromeClient; import android.webkit.WebView; import android.widget.FrameLayout; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.Toast; import java.util.List; /** * UI interface definitions */ public abstract class BaseUi implements UI, WebViewFactory { private static final String LOGTAG = "BaseUi"; protected static final FrameLayout.LayoutParams COVER_SCREEN_PARAMS = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); protected static final FrameLayout.LayoutParams COVER_SCREEN_GRAVITY_CENTER = new FrameLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, Gravity.CENTER); Activity mActivity; UiController mUiController; TabControl mTabControl; protected Tab mActiveTab; private InputMethodManager mInputManager; private Drawable mSecLockIcon; private Drawable mMixLockIcon; private FrameLayout mBrowserFrameLayout; protected FrameLayout mContentView; protected FrameLayout mCustomViewContainer; private View mCustomView; private WebChromeClient.CustomViewCallback mCustomViewCallback; private CombinedBookmarkHistoryView mComboView; private LinearLayout mErrorConsoleContainer = null; private Toast mStopToast; // the default