Home | History | Annotate | Download | only in webkit
      1 /*
      2  * Copyright (C) 2009 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 package android.webkit;
     17 
     18 import android.content.Context;
     19 import android.view.View;
     20 
     21 /**
     22  * This interface is used to implement plugins in a WebView. A plugin
     23  * package may extend this class and implement the abstract functions to create
     24  * embedded or fullscreeen views displayed in a WebView. The PluginStub
     25  * implementation will be provided the same NPP instance that is created
     26  * through the native interface.
     27  */
     28 public interface PluginStub {
     29 
     30     /**
     31      * Return a custom embedded view to draw the plugin.
     32      * @param NPP The native NPP instance.
     33      * @param context The current application's Context.
     34      * @return A custom View that will be managed by WebView.
     35      */
     36     public abstract View getEmbeddedView(int NPP, Context context);
     37 
     38     /**
     39      * Return a custom full-screen view to be displayed when the user requests
     40      * a plugin display as full-screen. Note that the application may choose not
     41      * to display this View as completely full-screen.
     42      * @param NPP The native NPP instance.
     43      * @param context The current application's Context.
     44      * @return A custom View that will be managed by the application.
     45      */
     46     public abstract View getFullScreenView(int NPP, Context context);
     47 }
     48