diff --git a/mobile/android/base/GeckoEvent.java b/mobile/android/base/GeckoEvent.java index f1d7096ceff..0338527d6cc 100644 --- a/mobile/android/base/GeckoEvent.java +++ b/mobile/android/base/GeckoEvent.java @@ -75,7 +75,6 @@ public class GeckoEvent { public static final int SURFACE_DESTROYED = 14; public static final int GECKO_EVENT_SYNC = 15; public static final int ACTIVITY_START = 17; - public static final int SAVE_STATE = 18; public static final int BROADCAST = 19; public static final int IME_COMPOSITION_END = 0; diff --git a/widget/src/android/AndroidJavaWrappers.cpp b/widget/src/android/AndroidJavaWrappers.cpp index 5f1e9297aa0..21bd063a1d2 100644 --- a/widget/src/android/AndroidJavaWrappers.cpp +++ b/widget/src/android/AndroidJavaWrappers.cpp @@ -491,11 +491,6 @@ AndroidGeckoEvent::Init(JNIEnv *jenv, jobject jobj) break; } - case SAVE_STATE: { - ReadCharactersField(jenv); - break; - } - default: break; } diff --git a/widget/src/android/AndroidJavaWrappers.h b/widget/src/android/AndroidJavaWrappers.h index 7241ca66c38..e0fe0c8a0b7 100644 --- a/widget/src/android/AndroidJavaWrappers.h +++ b/widget/src/android/AndroidJavaWrappers.h @@ -531,7 +531,6 @@ public: GECKO_EVENT_SYNC = 15, FORCED_RESIZE = 16, ACTIVITY_START = 17, - SAVE_STATE = 18, BROADCAST = 19, dummy_java_enum_list_end }; diff --git a/widget/src/android/nsWindow.cpp b/widget/src/android/nsWindow.cpp index bf236e01252..c928fa1593d 100644 --- a/widget/src/android/nsWindow.cpp +++ b/widget/src/android/nsWindow.cpp @@ -796,82 +796,6 @@ nsWindow::GetThebesSurface() return new gfxImageSurface(gfxIntSize(5,5), gfxImageSurface::ImageFormatRGB24); } - -class DrawToFileRunnable : public nsRunnable { -public: - DrawToFileRunnable(nsWindow* win, const nsAString &path) { - mPath = path; - mWindow = win; - } - NS_IMETHOD Run() { - mWindow->DrawToFile(mPath); - return NS_OK; - } -private: - nsString mPath; - nsRefPtr mWindow; -}; - -bool -nsWindow::DrawToFile(const nsAString &path) -{ - if (!IsTopLevel() || !mIsVisible) { - ALOG("### DrawToFile works only for a visible toplevel window!"); - return PR_FALSE; - } - - if (GetLayerManager(nsnull)->GetBackendType() != LayerManager::LAYERS_BASIC) { - ALOG("### DrawToFile works only for a basic layers!"); - return PR_FALSE; - } - - nsRefPtr imgSurface = - new gfxImageSurface(gfxIntSize(mBounds.width, mBounds.height), - gfxImageSurface::ImageFormatARGB32); - - if (imgSurface->CairoStatus()) { - ALOG("### Failed to create a valid surface"); - return PR_FALSE; - } - - nsIntRect boundsRect(0, 0, mBounds.width, mBounds.height); - bool result = DrawTo(imgSurface, boundsRect); - NS_ENSURE_TRUE(result, PR_FALSE); - - nsCOMPtr encoder = do_CreateInstance("@mozilla.org/image/encoder;2?type=image/png"); - NS_ENSURE_TRUE(encoder, PR_FALSE); - - encoder->InitFromData(imgSurface->Data(), - imgSurface->Stride() * mBounds.height, - mBounds.width, - mBounds.height, - imgSurface->Stride(), - imgIEncoder::INPUT_FORMAT_HOSTARGB, - EmptyString()); - - nsCOMPtr file; - NS_NewLocalFile(path, true, getter_AddRefs(file)); - NS_ENSURE_TRUE(file, PR_FALSE); - - PRUint32 length; - encoder->Available(&length); - - nsCOMPtr outputStream; - NS_NewLocalFileOutputStream(getter_AddRefs(outputStream), file); - NS_ENSURE_TRUE(outputStream, PR_FALSE); - - nsCOMPtr bufferedOutputStream; - NS_NewBufferedOutputStream(getter_AddRefs(bufferedOutputStream), - outputStream, length); - NS_ENSURE_TRUE(bufferedOutputStream, PR_FALSE); - - PRUint32 numWritten; - bufferedOutputStream->WriteFrom(encoder, length, &numWritten); - NS_ENSURE_SUCCESS(length == numWritten, PR_FALSE); - - return PR_TRUE; -} - void nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae) { @@ -1024,14 +948,6 @@ nsWindow::OnGlobalAndroidEvent(AndroidGeckoEvent *ae) AndroidBridge::Bridge()->AcknowledgeEventSync(); break; - case AndroidGeckoEvent::SAVE_STATE: - { - nsCOMPtr thread; - nsRefPtr runnable = new DrawToFileRunnable(win, ae->Characters()); - NS_NewThread(getter_AddRefs(thread), runnable); - } - break; - default: break; } diff --git a/widget/src/android/nsWindow.h b/widget/src/android/nsWindow.h index bc85d8a9f37..fb557ac63a2 100644 --- a/widget/src/android/nsWindow.h +++ b/widget/src/android/nsWindow.h @@ -177,8 +177,6 @@ public: static bool sAccessibilityEnabled; #endif - bool DrawToFile(const nsAString &path); - protected: void BringToFront(); nsWindow *FindTopLevel();