diff options
-rw-r--r-- | Source/WebCore/loader/SubresourceLoader.cpp | 2 | ||||
-rw-r--r-- | Source/WebCore/platform/MIMETypeRegistry.cpp | 1 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/BaseLayerAndroid.h | 1 | ||||
-rw-r--r-- | Source/WebCore/plugins/android/PluginViewAndroid.cpp | 2 | ||||
-rw-r--r-- | Source/WebCore/rendering/RenderLayer.cpp | 12 | ||||
-rw-r--r-- | Source/WebKit/Android.mk | 1 | ||||
-rw-r--r-- | Source/WebKit/android/jni/PictureSet.cpp | 16 | ||||
-rw-r--r-- | Source/WebKit/android/jni/PictureSet.h | 1 | ||||
-rw-r--r-- | Source/WebKit/android/jni/ViewStateSerializer.cpp | 97 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebCoreJniOnLoad.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.cpp | 8 | ||||
-rw-r--r-- | Source/WebKit/android/jni/WebViewCore.h | 2 | ||||
-rw-r--r-- | Source/WebKit/android/nav/WebView.cpp | 11 | ||||
-rw-r--r-- | Source/WebKit/android/plugins/ANPWindowInterface.cpp | 14 | ||||
-rw-r--r-- | Source/WebKit/android/plugins/PluginWidgetAndroid.cpp | 35 | ||||
-rw-r--r-- | Source/WebKit/android/plugins/PluginWidgetAndroid.h | 3 | ||||
-rw-r--r-- | Source/WebKit/android/plugins/android_npapi.h | 33 |
17 files changed, 225 insertions, 16 deletions
diff --git a/Source/WebCore/loader/SubresourceLoader.cpp b/Source/WebCore/loader/SubresourceLoader.cpp index 6f6adaf..f948ec3 100644 --- a/Source/WebCore/loader/SubresourceLoader.cpp +++ b/Source/WebCore/loader/SubresourceLoader.cpp @@ -75,7 +75,7 @@ PassRefPtr<SubresourceLoader> SubresourceLoader::create(Frame* frame, Subresourc FrameLoader::reportLocalLoadFailed(frame, request.url().string()); return 0; } - + if (SecurityOrigin::shouldHideReferrer(request.url(), fl->outgoingReferrer())) newRequest.clearHTTPReferrer(); else if (!request.httpReferrer()) diff --git a/Source/WebCore/platform/MIMETypeRegistry.cpp b/Source/WebCore/platform/MIMETypeRegistry.cpp index 4f9be57..e76906e 100644 --- a/Source/WebCore/platform/MIMETypeRegistry.cpp +++ b/Source/WebCore/platform/MIMETypeRegistry.cpp @@ -113,6 +113,7 @@ static void initializeSupportedImageMIMETypes() #elif PLATFORM(ANDROID) static const char* types[] = { "image/jpeg", + "image/webp", "image/png", "image/gif", "image/bmp", diff --git a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h index 38e7e47..e6680b5 100644 --- a/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/BaseLayerAndroid.h @@ -44,6 +44,7 @@ public: #if USE(ACCELERATED_COMPOSITING) void setGLWebViewState(GLWebViewState* infos) { m_glWebViewState = infos; } void setBackgroundColor(Color& color) { m_color = color; } + Color getBackgroundColor() { return m_color; } #endif void setContent(const android::PictureSet& src); void setExtra(SkPicture& extra); diff --git a/Source/WebCore/plugins/android/PluginViewAndroid.cpp b/Source/WebCore/plugins/android/PluginViewAndroid.cpp index 8b737ea..78d0217 100644 --- a/Source/WebCore/plugins/android/PluginViewAndroid.cpp +++ b/Source/WebCore/plugins/android/PluginViewAndroid.cpp @@ -106,6 +106,7 @@ extern void ANPSurfaceInterfaceV0_Init(ANPInterface* value); extern void ANPTypefaceInterfaceV0_Init(ANPInterface* value); extern void ANPWindowInterfaceV0_Init(ANPInterface* value); extern void ANPWindowInterfaceV1_Init(ANPInterface* value); +extern void ANPWindowInterfaceV2_Init(ANPInterface* value); extern void ANPSystemInterfaceV0_Init(ANPInterface* value); extern void ANPSystemInterfaceV1_Init(ANPInterface* value); extern void ANPSystemInterfaceV2_Init(ANPInterface* value); @@ -135,6 +136,7 @@ static const VarProcPair gVarProcs[] = { { VARPROCLINE(TypefaceInterfaceV0) }, { VARPROCLINE(WindowInterfaceV0) }, { VARPROCLINE(WindowInterfaceV1) }, + { VARPROCLINE(WindowInterfaceV2) }, { VARPROCLINE(SystemInterfaceV0) }, { VARPROCLINE(SystemInterfaceV1) }, { VARPROCLINE(SystemInterfaceV2) }, diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index 5f32933..bc0d440 100644 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -2633,16 +2633,10 @@ void RenderLayer::paintPaginatedChildLayer(RenderLayer* childLayer, RenderLayer* Vector<RenderLayer*> columnLayers; RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContext(); for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent()) { - if (curr->renderer()->hasColumns()) + if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagination(childLayer->renderer(), curr->renderBox())) columnLayers.append(curr); -#ifdef ANDROID - // Bug filed: 56107 if (curr == ancestorLayer) break; -#else - if (curr == ancestorLayer || (curr->parent() && curr->parent()->renderer()->isPositioned())) - break; -#endif } ASSERT(columnLayers.size()); @@ -3122,9 +3116,9 @@ RenderLayer* RenderLayer::hitTestPaginatedChildLayer(RenderLayer* childLayer, Re Vector<RenderLayer*> columnLayers; RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContext(); for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent()) { - if (curr->renderer()->hasColumns()) + if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagination(childLayer->renderer(), curr->renderBox())) columnLayers.append(curr); - if (curr == ancestorLayer || (curr->parent() && curr->parent()->renderer()->isPositioned())) + if (curr == ancestorLayer) break; } diff --git a/Source/WebKit/Android.mk b/Source/WebKit/Android.mk index 5998227..d02557e 100644 --- a/Source/WebKit/Android.mk +++ b/Source/WebKit/Android.mk @@ -83,6 +83,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES) \ android/jni/WebStorage.cpp \ android/jni/WebSettings.cpp \ android/jni/WebViewCore.cpp \ + android/jni/ViewStateSerializer.cpp \ \ android/nav/CacheBuilder.cpp \ android/nav/CachedColor.cpp \ diff --git a/Source/WebKit/android/jni/PictureSet.cpp b/Source/WebKit/android/jni/PictureSet.cpp index e4bd89c..181256c 100644 --- a/Source/WebKit/android/jni/PictureSet.cpp +++ b/Source/WebKit/android/jni/PictureSet.cpp @@ -81,6 +81,22 @@ PictureSet::PictureSet() mBaseArea = mAdditionalArea = 0; } +PictureSet::PictureSet(SkPicture* picture) +{ + if (!picture) + return; + Pictures pictureAndBounds; + pictureAndBounds.mPicture = picture; + SkSafeRef(pictureAndBounds.mPicture); + pictureAndBounds.mEmpty = false; + pictureAndBounds.mArea.setRect(0, 0, picture->width(), picture->height()); + pictureAndBounds.mSplit = false; + pictureAndBounds.mBase = true; + pictureAndBounds.mElapsed = 0; + pictureAndBounds.mWroteElapsed = false; + mPictures.append(pictureAndBounds); +} + PictureSet::~PictureSet() { clear(); diff --git a/Source/WebKit/android/jni/PictureSet.h b/Source/WebKit/android/jni/PictureSet.h index 907fb92..b04337c 100644 --- a/Source/WebKit/android/jni/PictureSet.h +++ b/Source/WebKit/android/jni/PictureSet.h @@ -54,6 +54,7 @@ namespace android { public: PictureSet(); PictureSet(const PictureSet& src) { set(src); } + PictureSet(SkPicture* picture); virtual ~PictureSet(); void add(const SkRegion& area, SkPicture* picture, uint32_t elapsed, bool split) diff --git a/Source/WebKit/android/jni/ViewStateSerializer.cpp b/Source/WebKit/android/jni/ViewStateSerializer.cpp new file mode 100644 index 0000000..c780e07 --- /dev/null +++ b/Source/WebKit/android/jni/ViewStateSerializer.cpp @@ -0,0 +1,97 @@ +/* + * Copyright 2011, The Android Open Source Project + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "config.h" + +#include "BaseLayerAndroid.h" +#include "CreateJavaOutputStreamAdaptor.h" +#include "PictureSet.h" +#include "SkPicture.h" + +#include <JNIUtility.h> +#include <JNIHelp.h> +#include <jni.h> + +namespace android { + +static bool nativeSerializeViewState(JNIEnv* env, jobject, jint jbaseLayer, + jobject jstream, jbyteArray jstorage) +{ + BaseLayerAndroid* baseLayer = (BaseLayerAndroid*) jbaseLayer; + if (!baseLayer) + return false; + + SkWStream *stream = CreateJavaOutputStreamAdaptor(env, jstream, jstorage); +#if USE(ACCELERATED_COMPOSITING) + stream->write32(baseLayer->getBackgroundColor().rgb()); +#else + stream->write32(0); +#endif + SkPicture picture; + PictureSet* content = baseLayer->content(); + baseLayer->drawCanvas(picture.beginRecording(content->width(), content->height(), + SkPicture::kUsePathBoundsForClip_RecordingFlag)); + picture.endRecording(); + if (!stream) + return false; + picture.serialize(stream); + delete stream; + return true; +} + +static BaseLayerAndroid* nativeDeserializeViewState(JNIEnv* env, jobject, jobject jstream, + jbyteArray jstorage) +{ + SkStream* stream = CreateJavaInputStreamAdaptor(env, jstream, jstorage); + if (!stream) + return 0; + BaseLayerAndroid* layer = new BaseLayerAndroid(); + Color color = stream->readU32(); +#if USE(ACCELERATED_COMPOSITING) + layer->setBackgroundColor(color); +#endif + SkPicture* picture = new SkPicture(stream); + delete stream; + layer->setContent(picture); + return layer; +} + +/* + * JNI registration + */ +static JNINativeMethod gSerializerMethods[] = { + { "nativeSerializeViewState", "(ILjava/io/OutputStream;[B)Z", + (void*) nativeSerializeViewState }, + { "nativeDeserializeViewState", "(Ljava/io/InputStream;[B)I", + (void*) nativeDeserializeViewState }, +}; + +int registerViewStateSerializer(JNIEnv* env) +{ + return jniRegisterNativeMethods(env, "android/webkit/ViewStateSerializer", + gSerializerMethods, NELEM(gSerializerMethods)); +} + +} diff --git a/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp b/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp index 1f264a2..e9d7bc3 100644 --- a/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp +++ b/Source/WebKit/android/jni/WebCoreJniOnLoad.cpp @@ -82,6 +82,7 @@ extern int registerWebHistory(JNIEnv*); extern int registerWebIconDatabase(JNIEnv*); extern int registerWebSettings(JNIEnv*); extern int registerWebView(JNIEnv*); +extern int registerViewStateSerializer(JNIEnv*); #if ENABLE(DATABASE) extern int registerWebStorage(JNIEnv*); #endif @@ -117,6 +118,7 @@ static RegistrationMethod gWebCoreRegMethods[] = { { "WebStorage", android::registerWebStorage }, #endif { "WebView", android::registerWebView }, + { "ViewStateSerializer", android::registerViewStateSerializer }, { "GeolocationPermissions", android::registerGeolocationPermissions }, { "MockGeolocation", android::registerMockGeolocation }, #if ENABLE(VIDEO) diff --git a/Source/WebKit/android/jni/WebViewCore.cpp b/Source/WebKit/android/jni/WebViewCore.cpp index ded3965..601d4ee 100644 --- a/Source/WebKit/android/jni/WebViewCore.cpp +++ b/Source/WebKit/android/jni/WebViewCore.cpp @@ -391,7 +391,7 @@ WebViewCore::WebViewCore(JNIEnv* env, jobject javaWebViewCore, WebCore::Frame* m m_javaGlue->m_addMessageToConsole = GetJMethod(env, clazz, "addMessageToConsole", "(Ljava/lang/String;ILjava/lang/String;I)V"); m_javaGlue->m_formDidBlur = GetJMethod(env, clazz, "formDidBlur", "(I)V"); m_javaGlue->m_getPluginClass = GetJMethod(env, clazz, "getPluginClass", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Class;"); - m_javaGlue->m_showFullScreenPlugin = GetJMethod(env, clazz, "showFullScreenPlugin", "(Landroid/webkit/ViewManager$ChildView;I)V"); + m_javaGlue->m_showFullScreenPlugin = GetJMethod(env, clazz, "showFullScreenPlugin", "(Landroid/webkit/ViewManager$ChildView;II)V"); m_javaGlue->m_hideFullScreenPlugin = GetJMethod(env, clazz, "hideFullScreenPlugin", "()V"); m_javaGlue->m_createSurface = GetJMethod(env, clazz, "createSurface", "(Landroid/view/View;)Landroid/webkit/ViewManager$ChildView;"); m_javaGlue->m_addSurface = GetJMethod(env, clazz, "addSurface", "(Landroid/view/View;IIII)Landroid/webkit/ViewManager$ChildView;"); @@ -3619,14 +3619,16 @@ jclass WebViewCore::getPluginClass(const WTF::String& libName, const char* class } } -void WebViewCore::showFullScreenPlugin(jobject childView, NPP npp) +void WebViewCore::showFullScreenPlugin(jobject childView, int32_t orientation, NPP npp) { JNIEnv* env = JSC::Bindings::getJNIEnv(); AutoJObject javaObject = m_javaGlue->object(env); if (!javaObject.get()) return; - env->CallVoidMethod(javaObject.get(), m_javaGlue->m_showFullScreenPlugin, childView, reinterpret_cast<int>(npp)); + env->CallVoidMethod(javaObject.get(), + m_javaGlue->m_showFullScreenPlugin, + childView, orientation, reinterpret_cast<int>(npp)); checkException(env); } diff --git a/Source/WebKit/android/jni/WebViewCore.h b/Source/WebKit/android/jni/WebViewCore.h index 0e9d80f..0dd45da 100644 --- a/Source/WebKit/android/jni/WebViewCore.h +++ b/Source/WebKit/android/jni/WebViewCore.h @@ -470,7 +470,7 @@ namespace android { jclass getPluginClass(const WTF::String& libName, const char* className); // Creates a full screen surface for a plugin - void showFullScreenPlugin(jobject webkitPlugin, NPP npp); + void showFullScreenPlugin(jobject webkitPlugin, int32_t orientation, NPP npp); // Instructs the UI thread to discard the plugin's full-screen surface void hideFullScreenPlugin(); diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 2494399..405b28e 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -1486,6 +1486,10 @@ Functor* getFunctor() { return m_glDrawFunctor; } +BaseLayerAndroid* getBaseLayer() { + return m_baseLayer; +} + private: // local state for WebView // private to getFrameCache(); other functions operate in a different thread CachedRoot* m_frameCacheUI; // navigation data ready for use @@ -1875,6 +1879,11 @@ static void nativeSetBaseLayer(JNIEnv *env, jobject obj, jint layer, jobject inv isPictureAfterFirstLayout); } +static BaseLayerAndroid* nativeGetBaseLayer(JNIEnv *env, jobject obj) +{ + return GET_NATIVE_VIEW(env, obj)->getBaseLayer(); +} + static void nativeReplaceBaseContent(JNIEnv *env, jobject obj, jint content) { PictureSet* set = reinterpret_cast<PictureSet*>(content); @@ -2664,6 +2673,8 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeSetHeightCanMeasure }, { "nativeSetBaseLayer", "(ILandroid/graphics/Region;ZZ)V", (void*) nativeSetBaseLayer }, + { "nativeGetBaseLayer", "()I", + (void*) nativeGetBaseLayer }, { "nativeReplaceBaseContent", "(I)V", (void*) nativeReplaceBaseContent }, { "nativeCopyBaseContentToPicture", "(Landroid/graphics/Picture;)V", diff --git a/Source/WebKit/android/plugins/ANPWindowInterface.cpp b/Source/WebKit/android/plugins/ANPWindowInterface.cpp index a74616c..cac8f8c 100644 --- a/Source/WebKit/android/plugins/ANPWindowInterface.cpp +++ b/Source/WebKit/android/plugins/ANPWindowInterface.cpp @@ -79,6 +79,12 @@ static ANPRectI anp_visibleRect(NPP instance) { return pluginWidget->visibleRect(); } +static void anp_requestFullScreenOrientation(NPP instance, ANPScreenOrientation orientation) { + PluginView* pluginView = pluginViewForInstance(instance); + PluginWidgetAndroid* pluginWidget = pluginView->platformPluginWidget(); + pluginWidget->setFullScreenOrientation(orientation); +} + /////////////////////////////////////////////////////////////////////////////// #define ASSIGN(obj, name) (obj)->name = anp_##name @@ -101,3 +107,11 @@ void ANPWindowInterfaceV1_Init(ANPInterface* value) { ANPWindowInterfaceV1* i = reinterpret_cast<ANPWindowInterfaceV1*>(value); ASSIGN(i, visibleRect); } + +void ANPWindowInterfaceV2_Init(ANPInterface* value) { + // initialize the functions from the previous interface + ANPWindowInterfaceV1_Init(value); + // add any new functions or override existing functions + ANPWindowInterfaceV2* i = reinterpret_cast<ANPWindowInterfaceV2*>(value); + ASSIGN(i, requestFullScreenOrientation); +} diff --git a/Source/WebKit/android/plugins/PluginWidgetAndroid.cpp b/Source/WebKit/android/plugins/PluginWidgetAndroid.cpp index b8a10cc..19433ab 100644 --- a/Source/WebKit/android/plugins/PluginWidgetAndroid.cpp +++ b/Source/WebKit/android/plugins/PluginWidgetAndroid.cpp @@ -45,7 +45,7 @@ #include "android_graphics.h" #include <JNIUtility.h> -// #define PLUGIN_DEBUG_LOCAL // controls the printing of log messages +#define PLUGIN_DEBUG_LOCAL // controls the printing of log messages #define DEBUG_EVENTS 0 // logs event contents, return value, and processing time #define DEBUG_VISIBLE_RECTS 0 // temporary debug printfs and fixes @@ -73,6 +73,7 @@ PluginWidgetAndroid::PluginWidgetAndroid(WebCore::PluginView* view) m_isSurfaceClippedOut = false; m_layer = 0; m_powerState = kDefault_ANPPowerState; + m_fullScreenOrientation = -1; } PluginWidgetAndroid::~PluginWidgetAndroid() { @@ -630,7 +631,8 @@ void PluginWidgetAndroid::requestFullScreen() { m_core->destroySurface(m_embeddedView); // add the full screen view - m_core->showFullScreenPlugin(m_embeddedView, m_pluginView->instance()); + m_core->showFullScreenPlugin(m_embeddedView, m_fullScreenOrientation, + m_pluginView->instance()); m_isFullScreen = true; } @@ -658,6 +660,35 @@ void PluginWidgetAndroid::exitFullScreen(bool pluginInitiated) { m_isFullScreen = false; } +void PluginWidgetAndroid::setFullScreenOrientation(ANPScreenOrientation orientation) { + + int internalOrienationId; + /* We need to validate that the input is legitimate and then convert the + * value from the plugin enum to the enum used by the android view system. + * The view system values correspond to those values for the + * screenOrientation attribute in R.java (see also ActivityInfo.java). + */ + switch (orientation) { + case kFixedLandscape_ANPScreenOrientation: + internalOrienationId = 0; + break; + case kFixedPortrait_ANPScreenOrientation: + internalOrienationId = 1; + break; + case kLandscape_ANPScreenOrientation: + internalOrienationId = 6; + break; + case kPortrait_ANPScreenOrientation: + internalOrienationId = 7; + break; + default: + internalOrienationId = -1; + } + + PLUGIN_LOG("%s orientation (%d)", __FUNCTION__, internalOrienationId); + m_fullScreenOrientation = internalOrienationId; +} + void PluginWidgetAndroid::requestCenterFitZoom() { m_core->centerFitRect(m_pluginWindow->x, m_pluginWindow->y, m_pluginWindow->width, m_pluginWindow->height); diff --git a/Source/WebKit/android/plugins/PluginWidgetAndroid.h b/Source/WebKit/android/plugins/PluginWidgetAndroid.h index 5d586b1..cbebb7f 100644 --- a/Source/WebKit/android/plugins/PluginWidgetAndroid.h +++ b/Source/WebKit/android/plugins/PluginWidgetAndroid.h @@ -150,6 +150,8 @@ struct PluginWidgetAndroid { bool inFullScreen() { return m_isFullScreen; } + void setFullScreenOrientation(ANPScreenOrientation orientation); + /** Called to check if a plugin currently has document focus, which is required for certain operations (e.g. show/hide keyboard). It returns true if the plugin currently has focus and false otherwise. @@ -204,6 +206,7 @@ private: bool m_acceptEvents; bool m_isSurfaceClippedOut; ANPPowerState m_powerState; + int m_fullScreenOrientation; /* We limit the number of rectangles to minimize storage and ensure adequate speed. diff --git a/Source/WebKit/android/plugins/android_npapi.h b/Source/WebKit/android/plugins/android_npapi.h index b0c3765..4ff45c8 100644 --- a/Source/WebKit/android/plugins/android_npapi.h +++ b/Source/WebKit/android/plugins/android_npapi.h @@ -127,6 +127,7 @@ typedef uint32_t ANPMatrixFlag; #define kSystemInterfaceV1_ANPGetValue ((NPNVariable)1016) #define kSystemInterfaceV2_ANPGetValue ((NPNVariable)1017) +#define kWindowInterfaceV2_ANPGetValue ((NPNVariable)1018) /** queries for the drawing models supported on this device. @@ -695,6 +696,38 @@ struct ANPWindowInterfaceV1 : ANPWindowInterfaceV0 { ANPRectI (*visibleRect)(NPP instance); }; +enum ANPScreenOrientations { + /** No preference specified: let the system decide the best orientation. + */ + kDefault_ANPScreenOrientation = 0, + /** Would like to have the screen in a landscape orientation, but it will + not allow for 180 degree rotations. + */ + kFixedLandscape_ANPScreenOrientation = 1, + /** Would like to have the screen in a portrait orientation, but it will + not allow for 180 degree rotations. + */ + kFixedPortrait_ANPScreenOrientation = 2, + /** Would like to have the screen in landscape orientation, but can use the + sensor to change which direction the screen is facing. + */ + kLandscape_ANPScreenOrientation = 3, + /** Would like to have the screen in portrait orientation, but can use the + sensor to change which direction the screen is facing. + */ + kPortrait_ANPScreenOrientation = 4 +}; +typedef int32_t ANPScreenOrientation; + +struct ANPWindowInterfaceV2 : ANPWindowInterfaceV1 { + /** Called when the plugin wants to specify a particular screen orientation + when entering into full screen mode. The orientation must be set prior + to entering into full screen. After entering full screen any subsequent + changes will be updated the next time the plugin goes full screen. + */ + void (*requestFullScreenOrientation)(NPP instance, ANPScreenOrientation orientation); +}; + /////////////////////////////////////////////////////////////////////////////// enum ANPSampleFormats { |