summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 21:58:05 +0000
committerojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-09 21:58:05 +0000
commit8a2820a90f85f91c500a9d382f8e8ba870fb621c (patch)
tree8d8bd23228cd1e6455e64b0de46e961947459382
parent283f76091ad757bdc17c6d9090209eade4211075 (diff)
downloadchromium_src-8a2820a90f85f91c500a9d382f8e8ba870fb621c.zip
chromium_src-8a2820a90f85f91c500a9d382f8e8ba870fb621c.tar.gz
chromium_src-8a2820a90f85f91c500a9d382f8e8ba870fb621c.tar.bz2
Patch by Thatcher Ulrich <tulrich@google.com>.
Implement "iframe shim" behavior for windowed plugins. In FF and IE on windows, iframes are implemented as native HWNDs. This has the side effect that iframes display on top of windowed plugins. This side effect has long been known as a workaround for allowing HTML elements to appear above plugin content. BUG=1788 Review URL: http://codereview.chromium.org/7032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3137 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/base.xcodeproj/project.pbxproj4
-rw-r--r--base/build/base_gfx.vcproj16
-rw-r--r--base/gfx/bitmap_platform_device_win.cc2
-rw-r--r--base/gfx/gdi_util.cc (renamed from base/gfx/bitmap_header.cc)18
-rw-r--r--base/gfx/gdi_util.h (renamed from base/gfx/bitmap_header.h)12
-rw-r--r--base/gfx/native_theme.cc2
-rw-r--r--base/gfx/vector_canvas_unittest.cc2
-rw-r--r--base/gfx/vector_device.cc2
-rw-r--r--base/tuple.h123
-rw-r--r--base/tuple_unittest.cc19
-rw-r--r--chrome/browser/drag_utils.cc2
-rw-r--r--chrome/browser/printing/printing_layout_uitest.cc2
-rw-r--r--chrome/browser/render_widget_host.cc3
-rw-r--r--chrome/browser/render_widget_host_hwnd.cc2
-rw-r--r--chrome/common/ipc_message_macros.h22
-rw-r--r--chrome/common/ipc_message_utils.h34
-rw-r--r--chrome/common/plugin_messages_internal.h3
-rw-r--r--chrome/common/render_messages.h4
-rw-r--r--chrome/common/win_util.cc2
-rw-r--r--chrome/plugin/webplugin_delegate_stub.cc4
-rw-r--r--chrome/plugin/webplugin_delegate_stub.h4
-rw-r--r--chrome/plugin/webplugin_proxy.cc5
-rw-r--r--chrome/plugin/webplugin_proxy.h1
-rw-r--r--chrome/renderer/render_view.cc2
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.cc14
-rw-r--r--chrome/renderer/webplugin_delegate_proxy.h5
-rw-r--r--webkit/build/glue/glue.vcproj8
-rwxr-xr-xwebkit/data/layout_tests/pending/plugins/iframe-shims-expected.txt6
-rwxr-xr-xwebkit/data/layout_tests/pending/plugins/iframe-shims.html144
-rw-r--r--webkit/data/layout_tests/pending/plugins/simple_blank.swfbin0 -> 37 bytes
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl.cc45
-rw-r--r--webkit/glue/plugins/webplugin_delegate_impl.h14
-rwxr-xr-xwebkit/glue/stacking_order_iterator.cc137
-rwxr-xr-xwebkit/glue/stacking_order_iterator.h73
-rw-r--r--webkit/glue/webcursor.cc2
-rw-r--r--webkit/glue/webplugin.h3
-rw-r--r--webkit/glue/webplugin_delegate.h16
-rw-r--r--webkit/glue/webplugin_impl.cc67
-rw-r--r--webkit/glue/webplugin_impl.h18
-rw-r--r--webkit/port/platform/graphics/ImageSkia.cpp2
-rw-r--r--webkit/port/platform/graphics/SkiaUtils.cpp2
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc3
42 files changed, 772 insertions, 77 deletions
diff --git a/base/base.xcodeproj/project.pbxproj b/base/base.xcodeproj/project.pbxproj
index b00cd28..1b211b8 100644
--- a/base/base.xcodeproj/project.pbxproj
+++ b/base/base.xcodeproj/project.pbxproj
@@ -558,8 +558,6 @@
8254038E0D92D2CF0006B936 /* word_iterator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = word_iterator.cc; sourceTree = "<group>"; };
8254038F0D92D2CF0006B936 /* word_iterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = word_iterator.h; sourceTree = "<group>"; };
825403B10D92D2E50006B936 /* libbase_gfx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libbase_gfx.a; sourceTree = BUILT_PRODUCTS_DIR; };
- 825403C00D92D31D0006B936 /* bitmap_header.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = bitmap_header.cc; sourceTree = "<group>"; };
- 825403C10D92D31D0006B936 /* bitmap_header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = bitmap_header.h; sourceTree = "<group>"; };
825403C40D92D31D0006B936 /* font_utils.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = font_utils.cc; sourceTree = "<group>"; };
825403C50D92D31D0006B936 /* font_utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = font_utils.h; sourceTree = "<group>"; };
825403C80D92D31D0006B936 /* native_theme.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = native_theme.cc; sourceTree = "<group>"; };
@@ -1058,8 +1056,6 @@
825403B40D92D2EC0006B936 /* gfx */ = {
isa = PBXGroup;
children = (
- 825403C00D92D31D0006B936 /* bitmap_header.cc */,
- 825403C10D92D31D0006B936 /* bitmap_header.h */,
AB6BC1ED0E54E836006436D5 /* bitmap_platform_device.h */,
829E2F940DBFD74B00819EBF /* bitmap_platform_device_mac.cc */,
829E2F950DBFD74B00819EBF /* bitmap_platform_device_mac.h */,
diff --git a/base/build/base_gfx.vcproj b/base/build/base_gfx.vcproj
index 329449b..79ce51d 100644
--- a/base/build/base_gfx.vcproj
+++ b/base/build/base_gfx.vcproj
@@ -122,14 +122,6 @@
</References>
<Files>
<File
- RelativePath="..\gfx\bitmap_header.cc"
- >
- </File>
- <File
- RelativePath="..\gfx\bitmap_header.h"
- >
- </File>
- <File
RelativePath="..\gfx\bitmap_platform_device_win.cc"
>
</File>
@@ -154,6 +146,14 @@
>
</File>
<File
+ RelativePath="..\gfx\gdi_util.cc"
+ >
+ </File>
+ <File
+ RelativePath="..\gfx\gdi_util.h"
+ >
+ </File>
+ <File
RelativePath="..\gfx\image_operations.cc"
>
</File>
diff --git a/base/gfx/bitmap_platform_device_win.cc b/base/gfx/bitmap_platform_device_win.cc
index 1209db1..2031027 100644
--- a/base/gfx/bitmap_platform_device_win.cc
+++ b/base/gfx/bitmap_platform_device_win.cc
@@ -4,7 +4,7 @@
#include "base/gfx/bitmap_platform_device_win.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/logging.h"
#include "base/process_util.h"
#include "SkMatrix.h"
diff --git a/base/gfx/bitmap_header.cc b/base/gfx/gdi_util.cc
index acaf0c0..48df853 100644
--- a/base/gfx/bitmap_header.cc
+++ b/base/gfx/gdi_util.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
namespace gfx {
@@ -60,5 +60,21 @@ void CreateMonochromeBitmapHeader(int width,
hdr->biClrImportant = 0;
}
+void SubtractRectanglesFromRegion(HRGN hrgn,
+ const std::vector<gfx::Rect>& cutouts) {
+ if (cutouts.size()) {
+ HRGN cutout = ::CreateRectRgn(0, 0, 0, 0);
+ for (size_t i = 0; i < cutouts.size(); i++) {
+ ::SetRectRgn(cutout,
+ cutouts[i].x(),
+ cutouts[i].y(),
+ cutouts[i].right(),
+ cutouts[i].bottom());
+ ::CombineRgn(hrgn, hrgn, cutout, RGN_DIFF);
+ }
+ ::DeleteObject(cutout);
+ }
+}
+
} // namespace gfx
diff --git a/base/gfx/bitmap_header.h b/base/gfx/gdi_util.h
index 0c8066b..cc15e92 100644
--- a/base/gfx/bitmap_header.h
+++ b/base/gfx/gdi_util.h
@@ -2,10 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef BASE_GFX_BITMAP_HEADER_H__
-#define BASE_GFX_BITMAP_HEADER_H__
+#ifndef BASE_GFX_GDI_UTIL_H__
+#define BASE_GFX_GDI_UTIL_H__
+#include <vector>
#include <windows.h>
+#include "base/gfx/rect.h"
namespace gfx {
@@ -25,8 +27,10 @@ void CreateBitmapV4Header(int width, int height, BITMAPV4HEADER* hdr);
// Creates a monochrome bitmap header.
void CreateMonochromeBitmapHeader(int width, int height, BITMAPINFOHEADER* hdr);
+// Modify the given hrgn by subtracting the given rectangles.
+void SubtractRectanglesFromRegion(HRGN hrgn,
+ const std::vector<gfx::Rect>& cutouts);
} // namespace gfx
-#endif // BASE_GFX_BITMAP_HEADER_H__
-
+#endif // BASE_GFX_GDI_UTIL_H__
diff --git a/base/gfx/native_theme.cc b/base/gfx/native_theme.cc
index ea55502..b8aa30c 100644
--- a/base/gfx/native_theme.cc
+++ b/base/gfx/native_theme.cc
@@ -9,7 +9,7 @@
#include <vsstyle.h>
#include <vssym32.h>
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/platform_canvas_win.h"
#include "base/gfx/skia_utils.h"
#include "base/gfx/rect.h"
diff --git a/base/gfx/vector_canvas_unittest.cc b/base/gfx/vector_canvas_unittest.cc
index 65d3d5f..60a79ba 100644
--- a/base/gfx/vector_canvas_unittest.cc
+++ b/base/gfx/vector_canvas_unittest.cc
@@ -8,7 +8,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/png_decoder.h"
#include "base/gfx/png_encoder.h"
#include "base/gfx/size.h"
diff --git a/base/gfx/vector_device.cc b/base/gfx/vector_device.cc
index 8778299..7230e2b 100644
--- a/base/gfx/vector_device.cc
+++ b/base/gfx/vector_device.cc
@@ -4,7 +4,7 @@
#include "base/gfx/vector_device.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/skia_utils.h"
#include "base/logging.h"
#include "base/scoped_handle.h"
diff --git a/base/tuple.h b/base/tuple.h
index c54b579..a515830 100644
--- a/base/tuple.h
+++ b/base/tuple.h
@@ -3,8 +3,8 @@
// found in the LICENSE file.
// A Tuple is a generic templatized container, similar in concept to std::pair.
-// There are classes Tuple0 to Tuple5, cooresponding to the number of elements
-// it contains. The convenient MakeTuple() function takes 0 to 5 arguments,
+// There are classes Tuple0 to Tuple6, cooresponding to the number of elements
+// it contains. The convenient MakeTuple() function takes 0 to 6 arguments,
// and will construct and return the appropriate Tuple object. The functions
// DispatchToMethod and DispatchToFunction take a function pointer or instance
// and method pointer, and unpack a tuple into arguments to the call.
@@ -193,6 +193,46 @@ public:
E e;
};
+template <class A, class B, class C, class D, class E, class F>
+struct Tuple6 {
+public:
+ typedef A TypeA;
+ typedef B TypeB;
+ typedef C TypeC;
+ typedef D TypeD;
+ typedef E TypeE;
+ typedef F TypeF;
+ typedef Tuple6<typename TupleTraits<A>::ValueType,
+ typename TupleTraits<B>::ValueType,
+ typename TupleTraits<C>::ValueType,
+ typename TupleTraits<D>::ValueType,
+ typename TupleTraits<E>::ValueType,
+ typename TupleTraits<F>::ValueType> ValueTuple;
+ typedef Tuple6<typename TupleTraits<A>::RefType,
+ typename TupleTraits<B>::RefType,
+ typename TupleTraits<C>::RefType,
+ typename TupleTraits<D>::RefType,
+ typename TupleTraits<E>::RefType,
+ typename TupleTraits<F>::RefType> RefTuple;
+
+ Tuple6() {}
+ Tuple6(typename TupleTraits<A>::ParamType a,
+ typename TupleTraits<B>::ParamType b,
+ typename TupleTraits<C>::ParamType c,
+ typename TupleTraits<D>::ParamType d,
+ typename TupleTraits<E>::ParamType e,
+ typename TupleTraits<F>::ParamType f)
+ : a(a), b(b), c(c), d(d), e(e), f(f) {
+ }
+
+ A a;
+ B b;
+ C c;
+ D d;
+ E e;
+ F f;
+};
+
// Tuple creators -------------------------------------------------------------
//
// Helper functions for constructing tuples while inferring the template
@@ -229,6 +269,12 @@ inline Tuple5<A, B, C, D, E> MakeTuple(const A& a, const B& b, const C& c,
return Tuple5<A, B, C, D, E>(a, b, c, d, e);
}
+template <class A, class B, class C, class D, class E, class F>
+inline Tuple6<A, B, C, D, E, F> MakeTuple(const A& a, const B& b, const C& c,
+ const D& d, const E& e, const F& f) {
+ return Tuple6<A, B, C, D, E, F>(a, b, c, d, e, f);
+}
+
// The following set of helpers make what Boost refers to as "Tiers" - a tuple
// of references.
@@ -257,6 +303,12 @@ inline Tuple5<A&, B&, C&, D&, E&> MakeRefTuple(A& a, B& b, C& c, D& d, E& e) {
return Tuple5<A&, B&, C&, D&, E&>(a, b, c, d, e);
}
+template <class A, class B, class C, class D, class E, class F>
+inline Tuple6<A&, B&, C&, D&, E&, F&> MakeRefTuple(A& a, B& b, C& c, D& d, E& e,
+ F& f) {
+ return Tuple6<A&, B&, C&, D&, E&, F&>(a, b, c, d, e, f);
+}
+
// Dispatchers ----------------------------------------------------------------
//
// Helper functions that call the given method on an object, with the unpacked
@@ -306,6 +358,13 @@ inline void DispatchToMethod(ObjT* obj, Method method,
(obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e);
}
+template<class ObjT, class Method, class A, class B, class C, class D, class E,
+ class F>
+inline void DispatchToMethod(ObjT* obj, Method method,
+ const Tuple6<A, B, C, D, E, F>& arg) {
+ (obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f);
+}
+
// Static Dispatchers with no out params.
template <class Function>
@@ -345,6 +404,12 @@ inline void DispatchToFunction(Function function,
(*function)(arg.a, arg.b, arg.c, arg.d, arg.e);
}
+template<class Function, class A, class B, class C, class D, class E, class F>
+inline void DispatchToFunction(Function function,
+ const Tuple6<A, B, C, D, E, F>& arg) {
+ (*function)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f);
+}
+
// Dispatchers with 0 out param (as a Tuple0).
template <class ObjT, class Method>
@@ -385,6 +450,13 @@ inline void DispatchToMethod(ObjT* obj, Method method,
(obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e);
}
+template<class ObjT, class Method, class A, class B, class C, class D, class E,
+ class F>
+inline void DispatchToMethod(ObjT* obj, Method method,
+ const Tuple6<A, B, C, D, E, F>& arg, Tuple0*) {
+ (obj->*method)(arg.a, arg.b, arg.c, arg.d, arg.e, arg.f);
+}
+
// Dispatchers with 1 out param.
template<class ObjT, class Method,
@@ -444,6 +516,15 @@ inline void DispatchToMethod(ObjT* obj, Method method,
(obj->*method)(in.a, in.b, in.c, in.d, in.e, &out->a);
}
+template<class ObjT, class Method,
+ class InA, class InB, class InC, class InD, class InE, class InF,
+ class OutA>
+inline void DispatchToMethod(ObjT* obj, Method method,
+ const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+ Tuple1<OutA>* out) {
+ (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f, &out->a);
+}
+
// Dispatchers with 2 out params.
template<class ObjT, class Method,
@@ -503,6 +584,15 @@ inline void DispatchToMethod(ObjT* obj, Method method,
(obj->*method)(in.a, in.b, in.c, in.d, in.e, &out->a, &out->b);
}
+template<class ObjT, class Method,
+ class InA, class InB, class InC, class InD, class InE, class InF,
+ class OutA, class OutB>
+inline void DispatchToMethod(ObjT* obj, Method method,
+ const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+ Tuple2<OutA, OutB>* out) {
+ (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f, &out->a, &out->b);
+}
+
// Dispatchers with 3 out params.
template<class ObjT, class Method,
@@ -562,6 +652,15 @@ inline void DispatchToMethod(ObjT* obj, Method method,
(obj->*method)(in.a, in.b, in.c, in.d, in.e, &out->a, &out->b, &out->c);
}
+template<class ObjT, class Method,
+ class InA, class InB, class InC, class InD, class InE, class InF,
+ class OutA, class OutB, class OutC>
+inline void DispatchToMethod(ObjT* obj, Method method,
+ const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+ Tuple3<OutA, OutB, OutC>* out) {
+ (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f, &out->a, &out->b, &out->c);
+}
+
// Dispatchers with 4 out params.
template<class ObjT, class Method,
@@ -622,6 +721,16 @@ inline void DispatchToMethod(ObjT* obj, Method method,
&out->a, &out->b, &out->c, &out->d);
}
+template<class ObjT, class Method,
+ class InA, class InB, class InC, class InD, class InE, class InF,
+ class OutA, class OutB, class OutC, class OutD>
+inline void DispatchToMethod(ObjT* obj, Method method,
+ const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+ Tuple4<OutA, OutB, OutC, OutD>* out) {
+ (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f,
+ &out->a, &out->b, &out->c, &out->d);
+}
+
// Dispatchers with 5 out params.
template<class ObjT, class Method,
@@ -683,5 +792,15 @@ inline void DispatchToMethod(ObjT* obj, Method method,
&out->a, &out->b, &out->c, &out->d, &out->e);
}
+template<class ObjT, class Method,
+ class InA, class InB, class InC, class InD, class InE, class InF,
+ class OutA, class OutB, class OutC, class OutD, class OutE>
+inline void DispatchToMethod(ObjT* obj, Method method,
+ const Tuple6<InA, InB, InC, InD, InE, InF>& in,
+ Tuple5<OutA, OutB, OutC, OutD, OutE>* out) {
+ (obj->*method)(in.a, in.b, in.c, in.d, in.e, in.f,
+ &out->a, &out->b, &out->c, &out->d, &out->e);
+}
+
#endif // BASE_TUPLE_H__
diff --git a/base/tuple_unittest.cc b/base/tuple_unittest.cc
index 36ea560..65a3757 100644
--- a/base/tuple_unittest.cc
+++ b/base/tuple_unittest.cc
@@ -18,6 +18,13 @@ struct Addy {
}
};
+struct Addz {
+ Addz() { }
+ void DoAdd(int a, int b, int c, int d, int e, int* res) {
+ *res = a + b + c + d + e;
+ }
+};
+
} // namespace
TEST(TupleTest, Basic) {
@@ -27,6 +34,7 @@ TEST(TupleTest, Basic) {
Tuple3<int, int, int> t3(1, 2, 3);
Tuple4<int, int, int, int*> t4(1, 2, 3, &t1.a);
Tuple5<int, int, int, int, int*> t5(1, 2, 3, 4, &t4.a);
+ Tuple6<int, int, int, int, int, int*> t6(1, 2, 3, 4, 5, &t4.a);
EXPECT_EQ(1, t1.a);
EXPECT_EQ(1, t2.a);
@@ -40,7 +48,11 @@ TEST(TupleTest, Basic) {
EXPECT_EQ(2, t5.b);
EXPECT_EQ(3, t5.c);
EXPECT_EQ(4, t5.d);
-
+ EXPECT_EQ(1, t6.a);
+ EXPECT_EQ(2, t6.b);
+ EXPECT_EQ(3, t6.c);
+ EXPECT_EQ(4, t6.d);
+ EXPECT_EQ(5, t6.e);
EXPECT_EQ(1, t1.a);
DispatchToFunction(&DoAdd, t4);
@@ -54,6 +66,11 @@ TEST(TupleTest, Basic) {
EXPECT_EQ(1, t4.a);
DispatchToMethod(&addy, &Addy::DoAdd, t5);
EXPECT_EQ(10, t4.a);
+
+ Addz addz;
+ EXPECT_EQ(10, t4.a);
+ DispatchToMethod(&addz, &Addz::DoAdd, t6);
+ EXPECT_EQ(15, t4.a);
}
namespace {
diff --git a/chrome/browser/drag_utils.cc b/chrome/browser/drag_utils.cc
index 5499c26..f0be9be 100644
--- a/chrome/browser/drag_utils.cc
+++ b/chrome/browser/drag_utils.cc
@@ -9,7 +9,7 @@
#include <shobjidl.h>
#include "base/file_util.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/point.h"
#include "base/string_util.h"
#include "chrome/app/theme/theme_resources.h"
diff --git a/chrome/browser/printing/printing_layout_uitest.cc b/chrome/browser/printing/printing_layout_uitest.cc
index 359237b..7299860 100644
--- a/chrome/browser/printing/printing_layout_uitest.cc
+++ b/chrome/browser/printing/printing_layout_uitest.cc
@@ -4,7 +4,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/platform_device_win.h"
#include "base/gfx/png_decoder.h"
#include "base/gfx/png_encoder.h"
diff --git a/chrome/browser/render_widget_host.cc b/chrome/browser/render_widget_host.cc
index 449b194..2966b6c 100644
--- a/chrome/browser/render_widget_host.cc
+++ b/chrome/browser/render_widget_host.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/render_widget_host.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/message_loop.h"
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/render_process_host.h"
@@ -451,6 +451,7 @@ void RenderWidgetHost::MovePluginWindows(
move.clip_rect.y(),
move.clip_rect.right(),
move.clip_rect.bottom());
+ gfx::SubtractRectanglesFromRegion(hrgn, move.cutout_rects);
// Note: System will own the hrgn after we call SetWindowRgn,
// so we don't need to call DeleteObject(hrgn)
diff --git a/chrome/browser/render_widget_host_hwnd.cc b/chrome/browser/render_widget_host_hwnd.cc
index 3ed7b6d..bc49e62 100644
--- a/chrome/browser/render_widget_host_hwnd.cc
+++ b/chrome/browser/render_widget_host_hwnd.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/render_widget_host_hwnd.h"
#include "base/command_line.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/rect.h"
#include "base/histogram.h"
#include "base/win_util.h"
diff --git a/chrome/common/ipc_message_macros.h b/chrome/common/ipc_message_macros.h
index 7278b4b..e724e2e 100644
--- a/chrome/common/ipc_message_macros.h
+++ b/chrome/common/ipc_message_macros.h
@@ -56,6 +56,7 @@
#undef IPC_MESSAGE_ROUTED3
#undef IPC_MESSAGE_ROUTED4
#undef IPC_MESSAGE_ROUTED5
+#undef IPC_MESSAGE_ROUTED6
#undef IPC_MESSAGE_EMPTY
#undef IPC_SYNC_MESSAGE_CONTROL0_0
#undef IPC_SYNC_MESSAGE_CONTROL0_1
@@ -146,6 +147,9 @@
#define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \
msg_class##__ID,
+#define IPC_MESSAGE_ROUTED6(msg_class, type1, type2, type3, type4, type5, type6) \
+ msg_class##__ID,
+
#define IPC_MESSAGE_EMPTY(msg_class) \
msg_class##__ID,
@@ -392,6 +396,9 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \
#define IPC_MESSAGE_ROUTED5(msg_class, type1, type2, type3, type4, type5) \
IPC_MESSAGE_LOG(msg_class)
+#define IPC_MESSAGE_ROUTED6(msg_class, type1, type2, type3, type4, type5, type6) \
+ IPC_MESSAGE_LOG(msg_class)
+
#define IPC_MESSAGE_EMPTY(msg_class) \
IPC_MESSAGE_LOG(msg_class)
@@ -633,6 +640,21 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \
routing_id, ID, MakeTuple(arg1, arg2, arg3, arg4, arg5)) {} \
};
+#define IPC_MESSAGE_ROUTED6(msg_class, type1, type2, type3, type4, type5, \
+ type6) \
+ class msg_class : \
+ public IPC::MessageWithTuple< Tuple6<type1, type2, type3, type4, type5, \
+ type6> > { \
+ public: \
+ enum { ID = msg_class##__ID }; \
+ msg_class(int32 routing_id, const type1& arg1, const type2& arg2, \
+ const type3& arg3, const type4& arg4, const type5& arg5, \
+ const type6& arg6) \
+ : IPC::MessageWithTuple< Tuple6<type1, type2, type3, type4, type5, \
+ type6> >( \
+ routing_id, ID, MakeTuple(arg1, arg2, arg3, arg4, arg5, arg6)) {} \
+ };
+
// Dummy class for now, just to give us the ID field.
#define IPC_MESSAGE_EMPTY(msg_class) \
class msg_class { \
diff --git a/chrome/common/ipc_message_utils.h b/chrome/common/ipc_message_utils.h
index 0c6ef8e..d5531e2 100644
--- a/chrome/common/ipc_message_utils.h
+++ b/chrome/common/ipc_message_utils.h
@@ -943,6 +943,40 @@ struct ParamTraits< Tuple5<A, B, C, D, E> > {
}
};
+template <class A, class B, class C, class D, class E, class F>
+struct ParamTraits< Tuple6<A, B, C, D, E, F> > {
+ typedef Tuple6<A, B, C, D, E, F> param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.a);
+ WriteParam(m, p.b);
+ WriteParam(m, p.c);
+ WriteParam(m, p.d);
+ WriteParam(m, p.e);
+ WriteParam(m, p.f);
+ }
+ static bool Read(const Message* m, void** iter, param_type* r) {
+ return (ReadParam(m, iter, &r->a) &&
+ ReadParam(m, iter, &r->b) &&
+ ReadParam(m, iter, &r->c) &&
+ ReadParam(m, iter, &r->d) &&
+ ReadParam(m, iter, &r->e) &&
+ ReadParam(m, iter, &r->f));
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ LogParam(p.a, l);
+ l->append(L", ");
+ LogParam(p.b, l);
+ l->append(L", ");
+ LogParam(p.c, l);
+ l->append(L", ");
+ LogParam(p.d, l);
+ l->append(L", ");
+ LogParam(p.e, l);
+ l->append(L", ");
+ LogParam(p.f, l);
+ }
+};
+
template <>
struct ParamTraits<webkit_glue::WebApplicationInfo> {
typedef webkit_glue::WebApplicationInfo param_type;
diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h
index 1059418..f2676fd 100644
--- a/chrome/common/plugin_messages_internal.h
+++ b/chrome/common/plugin_messages_internal.h
@@ -124,9 +124,10 @@ IPC_BEGIN_MESSAGES(Plugin, 5)
// contains a buffer that the plugin draws into. background_buffer is used
// for transparent windowless plugins, and holds the background of the plugin
// rectangle.
- IPC_MESSAGE_ROUTED5(PluginMsg_UpdateGeometry,
+ IPC_MESSAGE_ROUTED6(PluginMsg_UpdateGeometry,
gfx::Rect /* window_rect */,
gfx::Rect /* clip_rect */,
+ std::vector<gfx::Rect> /* cutout_rects */,
bool /* visible */,
SharedMemoryHandle /* windowless_buffer */,
SharedMemoryHandle /* background_buffer */)
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index c4038a2..a4e30a4 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -1007,6 +1007,7 @@ struct ParamTraits<WebPluginGeometry> {
WriteParam(m, p.window);
WriteParam(m, p.window_rect);
WriteParam(m, p.clip_rect);
+ WriteParam(m, p.cutout_rects);
WriteParam(m, p.visible);
}
static bool Read(const Message* m, void** iter, param_type* p) {
@@ -1014,6 +1015,7 @@ struct ParamTraits<WebPluginGeometry> {
ReadParam(m, iter, &p->window) &&
ReadParam(m, iter, &p->window_rect) &&
ReadParam(m, iter, &p->clip_rect) &&
+ ReadParam(m, iter, &p->cutout_rects) &&
ReadParam(m, iter, &p->visible);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -1024,6 +1026,8 @@ struct ParamTraits<WebPluginGeometry> {
l->append(L", ");
LogParam(p.clip_rect, l);
l->append(L", ");
+ LogParam(p.cutout_rects, l);
+ l->append(L", ");
LogParam(p.visible, l);
l->append(L")");
}
diff --git a/chrome/common/win_util.cc b/chrome/common/win_util.cc
index b0ef230..9b51220 100644
--- a/chrome/common/win_util.cc
+++ b/chrome/common/win_util.cc
@@ -12,7 +12,7 @@
#include <shlobj.h>
#include "base/file_util.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/png_encoder.h"
#include "base/logging.h"
#include "base/registry.h"
diff --git a/chrome/plugin/webplugin_delegate_stub.cc b/chrome/plugin/webplugin_delegate_stub.cc
index 84bc069..69177e1 100644
--- a/chrome/plugin/webplugin_delegate_stub.cc
+++ b/chrome/plugin/webplugin_delegate_stub.cc
@@ -237,11 +237,13 @@ void WebPluginDelegateStub::OnPrint(PluginMsg_PrintResponse_Params* params) {
void WebPluginDelegateStub::OnUpdateGeometry(
const gfx::Rect& window_rect,
const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
bool visible,
const SharedMemoryHandle& windowless_buffer,
const SharedMemoryHandle& background_buffer) {
webplugin_->UpdateGeometry(
- window_rect, clip_rect, visible, windowless_buffer, background_buffer);
+ window_rect, clip_rect, cutout_rects, visible, windowless_buffer,
+ background_buffer);
}
void WebPluginDelegateStub::OnGetPluginScriptableObject(int* route_id,
diff --git a/chrome/plugin/webplugin_delegate_stub.h b/chrome/plugin/webplugin_delegate_stub.h
index 78684bf..fb7d4dd 100644
--- a/chrome/plugin/webplugin_delegate_stub.h
+++ b/chrome/plugin/webplugin_delegate_stub.h
@@ -64,7 +64,9 @@ class WebPluginDelegateStub : public IPC::Channel::Listener,
void OnPrint(PluginMsg_PrintResponse_Params* params);
void OnUpdateGeometry(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect, bool visible,
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible,
const SharedMemoryHandle& windowless_buffer,
const SharedMemoryHandle& background_buffer);
void OnGetPluginScriptableObject(int* route_id, void** npobject_ptr);
diff --git a/chrome/plugin/webplugin_proxy.cc b/chrome/plugin/webplugin_proxy.cc
index 9528490..56beb25c 100644
--- a/chrome/plugin/webplugin_proxy.cc
+++ b/chrome/plugin/webplugin_proxy.cc
@@ -4,7 +4,7 @@
#include "chrome/plugin/webplugin_proxy.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/platform_device_win.h"
#include "base/scoped_handle.h"
#include "base/shared_memory.h"
@@ -277,13 +277,14 @@ void WebPluginProxy::Paint(const gfx::Rect& rect) {
void WebPluginProxy::UpdateGeometry(
const gfx::Rect& window_rect,
const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
bool visible,
const SharedMemoryHandle& windowless_buffer,
const SharedMemoryHandle& background_buffer) {
gfx::Rect old = delegate_->rect();
bool moved = delegate_->rect().x() != window_rect.x() ||
delegate_->rect().y() != window_rect.y();
- delegate_->UpdateGeometry(window_rect, clip_rect, visible);
+ delegate_->UpdateGeometry(window_rect, clip_rect, cutout_rects, visible);
if (windowless_buffer) {
// The plugin's rect changed, so now we have a new buffer to draw into.
SetWindowlessBuffer(windowless_buffer, background_buffer);
diff --git a/chrome/plugin/webplugin_proxy.h b/chrome/plugin/webplugin_proxy.h
index ab50933..5374d1c 100644
--- a/chrome/plugin/webplugin_proxy.h
+++ b/chrome/plugin/webplugin_proxy.h
@@ -81,6 +81,7 @@ class WebPluginProxy : public WebPlugin {
void UpdateGeometry(const gfx::Rect& window_rect,
const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
bool visible,
const SharedMemoryHandle& windowless_buffer,
const SharedMemoryHandle& background_buffer);
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 4fe474d..722e67f 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -9,7 +9,7 @@
#include <vector>
#include "base/command_line.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/bitmap_platform_device_win.h"
#include "base/gfx/image_operations.h"
#include "base/gfx/native_theme.h"
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index 1d6e8d21..315fc89 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -183,6 +183,7 @@ void WebPluginDelegateProxy::FlushGeometryUpdates() {
Send(new PluginMsg_UpdateGeometry(instance_id_,
plugin_rect_,
deferred_clip_rect_,
+ deferred_cutout_rects_,
visible_,
NULL,
NULL));
@@ -333,12 +334,15 @@ void WebPluginDelegateProxy::OnChannelError() {
render_view_->PluginCrashed(plugin_path_);
}
-void WebPluginDelegateProxy::UpdateGeometry(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect,
- bool visible) {
+void WebPluginDelegateProxy::UpdateGeometry(
+ const gfx::Rect& window_rect,
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible) {
plugin_rect_ = window_rect;
if (!windowless_) {
deferred_clip_rect_ = clip_rect;
+ deferred_cutout_rects_ = cutout_rects;
visible_ = visible;
send_deferred_update_geometry_ = true;
return;
@@ -369,8 +373,8 @@ void WebPluginDelegateProxy::UpdateGeometry(const gfx::Rect& window_rect,
}
IPC::Message* msg = new PluginMsg_UpdateGeometry(
- instance_id_, window_rect, clip_rect, visible, transport_store_handle,
- background_store_handle);
+ instance_id_, window_rect, clip_rect, cutout_rects, visible,
+ transport_store_handle, background_store_handle);
msg->set_unblock(true);
Send(msg);
}
diff --git a/chrome/renderer/webplugin_delegate_proxy.h b/chrome/renderer/webplugin_delegate_proxy.h
index 7a7da77..b401baa 100644
--- a/chrome/renderer/webplugin_delegate_proxy.h
+++ b/chrome/renderer/webplugin_delegate_proxy.h
@@ -52,7 +52,9 @@ class WebPluginDelegateProxy : public WebPluginDelegate,
virtual bool Initialize(const GURL& url, char** argn, char** argv, int argc,
WebPlugin* plugin, bool load_manually);
virtual void UpdateGeometry(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect, bool visible);
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible);
virtual void Paint(HDC hdc, const gfx::Rect& rect);
virtual void Print(HDC hdc);
virtual NPObject* GetPluginScriptableObject();
@@ -157,6 +159,7 @@ class WebPluginDelegateProxy : public WebPluginDelegate,
gfx::Rect plugin_rect_;
gfx::Rect deferred_clip_rect_;
+ std::vector<gfx::Rect> deferred_cutout_rects_;
bool send_deferred_update_geometry_;
bool visible_;
diff --git a/webkit/build/glue/glue.vcproj b/webkit/build/glue/glue.vcproj
index bd7c70c..aab75ce 100644
--- a/webkit/build/glue/glue.vcproj
+++ b/webkit/build/glue/glue.vcproj
@@ -481,6 +481,14 @@
>
</File>
<File
+ RelativePath="..\..\glue\stacking_order_iterator.cc"
+ >
+ </File>
+ <File
+ RelativePath="..\..\glue\stacking_order_iterator.h"
+ >
+ </File>
+ <File
RelativePath="..\..\glue\webcursor.cc"
>
</File>
diff --git a/webkit/data/layout_tests/pending/plugins/iframe-shims-expected.txt b/webkit/data/layout_tests/pending/plugins/iframe-shims-expected.txt
new file mode 100755
index 0000000..d1cde7e
--- /dev/null
+++ b/webkit/data/layout_tests/pending/plugins/iframe-shims-expected.txt
@@ -0,0 +1,6 @@
+Test that iframe shims can be used to overlay HTML above a windowed plugin. The red squares should be hidden by the blue flash plugin, and the green squares should appear over it. To test interactively, click over the buttons on the squares. You should not be able to reach the red squares' buttons.
+
+Prints "SUCCESS" on success, "FAILURE" on failure.
+
+SUCCESS
+
diff --git a/webkit/data/layout_tests/pending/plugins/iframe-shims.html b/webkit/data/layout_tests/pending/plugins/iframe-shims.html
new file mode 100755
index 0000000..28d7f25
--- /dev/null
+++ b/webkit/data/layout_tests/pending/plugins/iframe-shims.html
@@ -0,0 +1,144 @@
+<html><head>
+<script>
+ function noop(x) {
+ }
+
+ var red1_clicks = 0;
+ var green1_clicks = 0;
+ var red2_clicks = 0;
+ var green2_clicks = 0;
+
+ function red1Clicked() {
+ red1_clicks++;
+ checkResult();
+ }
+
+ function green1Clicked() {
+ green1_clicks++;
+ checkResult();
+ }
+
+ function red2Clicked() {
+ red2_clicks++;
+ checkResult();
+ }
+
+ function green2Clicked() {
+ green2_clicks++;
+ checkResult();
+ }
+
+ function checkResult() {
+ var output = document.getElementById("output");
+ var success = green1_clicks > 0 && green2_clicks > 0 &&
+ red1_clicks == 0 && red2_clicks == 0;
+ output.innerHTML = success ? "SUCCESS" : "FAILURE";
+ document.title = output.innerHTML;
+ }
+
+ function moveMouseOver(elem_name) {
+ var elem = document.getElementById(elem_name);
+ var x = elem.offsetLeft + elem.scrollWidth / 2;
+ var y = elem.offsetTop + elem.scrollHeight / 2;
+ var offsetParent = elem.offsetParent;
+ while (offsetParent) {
+ x += offsetParent.offsetLeft;
+ y += offsetParent.offsetTop;
+ offsetParent = offsetParent.offsetParent;
+ }
+ eventSender.mouseMoveTo(x, y);
+ }
+
+ function runTest() {
+ if (window.layoutTestController && window.eventSender) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.dumpAsText();
+ setTimeout(doClickRed1, 0);
+ }
+ }
+
+ function doClickRed1() {
+ moveMouseOver("red_square1");
+ eventSender.mouseDown();
+ setTimeout(doClickGreen1, 0);
+ }
+
+ function doClickGreen1() {
+ eventSender.mouseUp();
+ moveMouseOver("green_square1");
+ eventSender.mouseDown();
+ setTimeout(doClickRed2, 0);
+ }
+
+ function doClickRed2() {
+ eventSender.mouseUp();
+ moveMouseOver("red_square2");
+ eventSender.mouseDown();
+ setTimeout(doClickGreen2, 0);
+ }
+
+ function doClickGreen2() {
+ eventSender.mouseUp();
+ moveMouseOver("green_square2");
+ eventSender.mouseDown();
+ setTimeout(finishTest, 0);
+ }
+
+ function finishTest() {
+ eventSender.mouseUp();
+ layoutTestController.notifyDone();
+ }
+</script>
+</head>
+<body onload="runTest()">
+
+<p>Test that iframe shims can be used to overlay HTML above a windowed
+plugin. The red squares should be hidden by the blue flash plugin, and
+the green squares should appear over it. To test interactively, click
+over the buttons on the squares. You should not be able to reach the
+red squares' buttons.</p>
+
+<p>Prints "SUCCESS" on success, "FAILURE" on failure.</p>
+
+<div id=output>NONE</div>
+
+<div style="position: relative;">
+
+ <!-- div with a lower stacking order than the plugin, appearing earlier in the document -->
+ <div id="red_square1"
+ style="z-index: 50; background-color: #FF0000; position: absolute; top: -10; left: 50; width: 100px; height: 100px; overflow: hidden;">
+ <input type="button" onclick="red1Clicked()" value="red" style="position: absolute; top: 10; left: 10; width: 80px; height: 80px;"/>
+ <iframe src="javascript:void(0);" frameborder=0 style="z-index: -1; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;"></iframe>
+ </div>
+
+ <!-- div with a higher stacking order than the plugin, appearing earlier in the document -->
+ <div id="green_square1"
+ style="z-index: 150; background-color: #00FF00; position: absolute; top: -10; left: 250; width: 100px; height: 100px; overflow: hidden;">
+ <input type="button" onclick="green1Clicked()" value="green" style="position: absolute; top: 10; left: 10; width: 80px; height: 80px;"/>
+ <iframe src="javascript:void(0);" frameborder=0 style="z-index: -1; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;"></iframe>
+ </div>
+
+ <div id="embed_parent" style="position: absolute; z-index: 100"
+ <embed width="400" height="200" wmode="window" loop="false" quality="high" src="simple_blank.swf" type="application/x-shockwave-flash" />
+ </div>
+
+ <!-- div with a lower stacking order than the plugin, appearing later in the document -->
+ <div id="red_square2"
+ style="z-index: 50; background-color: #FF0000; position: absolute; top: 110; left: 50; width: 100px; height: 100px; overflow: hidden;">
+ <input type="button" onclick="red2Clicked()" value="red" style="position: absolute; top: 10; left: 10; width: 80px; height: 80px;"/>
+ <iframe src="javascript:void(0);" frameborder=0 style="z-index: -1; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;"></iframe>
+ </div>
+
+ <!-- div with a higher stacking order than the plugin, appearing later in the document -->
+ <div id="green_square2"
+ style="z-index: 150; background-color: #00FF00; position: absolute; top: 110; left: 250; width: 100px; height: 100px; overflow: hidden;">
+ <input type="button" onclick="green2Clicked()" value="green" style="position: absolute; top: 10; left: 10; width: 80px; height: 80px;"/>
+ <iframe src="javascript:void(0);" frameborder=0 style="z-index: -1; position: absolute; left: 0px; top: 0px; width: 100%; height: 100%;"></iframe>
+ </div>
+
+
+
+</div>
+
+</body>
+</html> \ No newline at end of file
diff --git a/webkit/data/layout_tests/pending/plugins/simple_blank.swf b/webkit/data/layout_tests/pending/plugins/simple_blank.swf
new file mode 100644
index 0000000..b846387
--- /dev/null
+++ b/webkit/data/layout_tests/pending/plugins/simple_blank.swf
Binary files differ
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.cc b/webkit/glue/plugins/webplugin_delegate_impl.cc
index 4e1c713..fa2a64f 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl.cc
+++ b/webkit/glue/plugins/webplugin_delegate_impl.cc
@@ -6,6 +6,7 @@
#include "base/file_util.h"
#include "base/message_loop.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/point.h"
#include "base/stats_counters.h"
#include "webkit/default_plugin/plugin_impl.h"
@@ -250,13 +251,15 @@ void WebPluginDelegateImpl::DestroyInstance() {
}
}
-void WebPluginDelegateImpl::UpdateGeometry(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect,
- bool visible) {
+void WebPluginDelegateImpl::UpdateGeometry(
+ const gfx::Rect& window_rect,
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible) {
if (windowless_) {
WindowlessUpdateGeometry(window_rect, clip_rect);
} else {
- WindowedUpdateGeometry(window_rect, clip_rect, visible);
+ WindowedUpdateGeometry(window_rect, clip_rect, cutout_rects, visible);
}
// Initiate a download on the plugin url. This should be done for the
@@ -344,10 +347,12 @@ void WebPluginDelegateImpl::InstallMissingPlugin() {
instance()->NPP_HandleEvent(&evt);
}
-void WebPluginDelegateImpl::WindowedUpdateGeometry(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect,
- bool visible) {
- if (WindowedReposition(window_rect, clip_rect, visible) ||
+void WebPluginDelegateImpl::WindowedUpdateGeometry(
+ const gfx::Rect& window_rect,
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible) {
+ if (WindowedReposition(window_rect, clip_rect, cutout_rects, visible) ||
!windowed_did_set_window_) {
// Let the plugin know that it has been moved
WindowedSetWindow();
@@ -584,14 +589,17 @@ bool WebPluginDelegateImpl::CreateDummyWindowForActivation() {
return true;
}
-void WebPluginDelegateImpl::MoveWindow(HWND window,
- const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect,
- bool visible) {
+void WebPluginDelegateImpl::MoveWindow(
+ HWND window,
+ const gfx::Rect& window_rect,
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible) {
HRGN hrgn = ::CreateRectRgn(clip_rect.x(),
clip_rect.y(),
clip_rect.right(),
clip_rect.bottom());
+ gfx::SubtractRectanglesFromRegion(hrgn, cutout_rects);
// Note: System will own the hrgn after we call SetWindowRgn,
// so we don't need to call DeleteObject(hrgn)
@@ -612,20 +620,24 @@ void WebPluginDelegateImpl::MoveWindow(HWND window,
flags);
}
-bool WebPluginDelegateImpl::WindowedReposition(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect,
- bool visible) {
+bool WebPluginDelegateImpl::WindowedReposition(
+ const gfx::Rect& window_rect,
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible) {
if (!windowed_handle_) {
NOTREACHED();
return false;
}
if (window_rect_ == window_rect && clip_rect_ == clip_rect &&
+ cutout_rects == cutout_rects_ &&
initial_plugin_resize_done_)
return false;
window_rect_ = window_rect;
clip_rect_ = clip_rect;
+ cutout_rects_ = cutout_rects;
if (!initial_plugin_resize_done_) {
// We need to ensure that the plugin process continues to reposition
@@ -636,7 +648,7 @@ bool WebPluginDelegateImpl::WindowedReposition(const gfx::Rect& window_rect,
// We created the window with 0 width and height since we didn't know it
// at the time. Now that we know the geometry, we we can update its size
// since the browser only calls SetWindowPos when scrolling occurs.
- MoveWindow(windowed_handle_, window_rect, clip_rect, visible);
+ MoveWindow(windowed_handle_, window_rect, clip_rect, cutout_rects, visible);
// Ensure that the entire window gets repainted.
::InvalidateRect(windowed_handle_, NULL, FALSE);
}
@@ -791,6 +803,7 @@ void WebPluginDelegateImpl::WindowlessUpdateGeometry(
// We will inform the instance of this change when we call NPP_SetWindow.
clip_rect_ = clip_rect;
+ cutout_rects_.clear();
if (window_rect_ != window_rect) {
window_rect_ = window_rect;
diff --git a/webkit/glue/plugins/webplugin_delegate_impl.h b/webkit/glue/plugins/webplugin_delegate_impl.h
index 7ef9d80..51d0b9b 100644
--- a/webkit/glue/plugins/webplugin_delegate_impl.h
+++ b/webkit/glue/plugins/webplugin_delegate_impl.h
@@ -41,7 +41,9 @@ class WebPluginDelegateImpl : public WebPluginDelegate {
WebPlugin* plugin,
bool load_manually);
virtual void UpdateGeometry(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect, bool visible);
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible);
virtual void Paint(HDC hdc, const gfx::Rect& rect);
virtual void Print(HDC hdc);
virtual void SetFocus(); // only called when windowless
@@ -93,6 +95,7 @@ class WebPluginDelegateImpl : public WebPluginDelegate {
static void MoveWindow(HWND window,
const gfx::Rect& window_rect,
const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
bool visible);
private:
@@ -103,7 +106,9 @@ class WebPluginDelegateImpl : public WebPluginDelegate {
//--------------------------
// used for windowed plugins
void WindowedUpdateGeometry(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect, bool visible);
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible);
// Create the native window.
// Returns true if the window is created (or already exists).
// Returns false if unable to create the window.
@@ -115,7 +120,9 @@ class WebPluginDelegateImpl : public WebPluginDelegate {
// Reposition the native window to be in sync with the given geometry.
// Returns true if the native window has moved or been clipped differently.
bool WindowedReposition(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect, bool visible);
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible);
// Tells the plugin about the current state of the window.
// See NPAPI NPP_SetWindow for more information.
@@ -187,6 +194,7 @@ class WebPluginDelegateImpl : public WebPluginDelegate {
NPWindow window_;
gfx::Rect window_rect_;
gfx::Rect clip_rect_;
+ std::vector<gfx::Rect> cutout_rects_;
int quirks_;
// We only move/size the plugin window once after its creation. The
diff --git a/webkit/glue/stacking_order_iterator.cc b/webkit/glue/stacking_order_iterator.cc
new file mode 100755
index 0000000..b726a8a
--- /dev/null
+++ b/webkit/glue/stacking_order_iterator.cc
@@ -0,0 +1,137 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+
+#pragma warning(push, 0)
+#include "RenderLayer.h"
+#include "RenderObject.h"
+#pragma warning(pop)
+#undef LOG
+
+#include "webkit/glue/stacking_order_iterator.h"
+
+//
+// RenderLayerIterator
+//
+
+RenderLayerIterator::RenderLayerIterator() {
+}
+
+void RenderLayerIterator::Reset(WebCore::RenderLayer* rl) {
+ if (rl) {
+ context_stack_.push_back(Context(rl));
+ }
+}
+
+WebCore::RenderLayer* RenderLayerIterator::Next() {
+ while (context_stack_.size()) {
+ Context* ctx = &(context_stack_.back());
+ if (ctx->HasMoreNeg()) {
+ context_stack_.push_back(ctx->NextNeg());
+ } else if (ctx->HasSelf()) {
+ // Emit self.
+ return ctx->NextSelf();
+ } else if (ctx->HasMoreOverflow()) {
+ context_stack_.push_back(ctx->NextOverflow());
+ } else if (ctx->HasMorePos()) {
+ context_stack_.push_back(ctx->NextPos());
+ } else {
+ // Nothing left in this context. Pop.
+ context_stack_.pop_back();
+ }
+ }
+ return NULL;
+}
+
+RenderLayerIterator::Context::Context(WebCore::RenderLayer* layer)
+ : layer_(layer),
+ next_neg_(0),
+ next_self_(0),
+ next_overflow_(0),
+ next_pos_(0) {
+ ASSERT(layer_);
+ layer_->updateZOrderLists();
+ layer_->updateOverflowList();
+}
+
+bool RenderLayerIterator::Context::HasMoreNeg() {
+ return layer_->negZOrderList() &&
+ next_neg_ < layer_->negZOrderList()->size();
+}
+
+RenderLayerIterator::Context RenderLayerIterator::Context::NextNeg() {
+ ASSERT(HasMoreNeg());
+ return Context(layer_->negZOrderList()->at(next_neg_++));
+}
+
+bool RenderLayerIterator::Context::HasSelf() {
+ return next_self_ < 1;
+}
+
+WebCore::RenderLayer* RenderLayerIterator::Context::NextSelf() {
+ ASSERT(HasSelf());
+ next_self_ = 1;
+ return layer_;
+}
+
+bool RenderLayerIterator::Context::HasMoreOverflow() {
+ return layer_->overflowList() &&
+ next_overflow_ >= 0 &&
+ next_overflow_ < layer_->overflowList()->size();
+}
+
+RenderLayerIterator::Context RenderLayerIterator::Context::NextOverflow() {
+ ASSERT(HasMoreOverflow());
+ return Context(layer_->overflowList()->at(next_overflow_++));
+}
+
+bool RenderLayerIterator::Context::HasMorePos() {
+ return layer_->posZOrderList() &&
+ next_pos_ < layer_->posZOrderList()->size();
+}
+
+RenderLayerIterator::Context RenderLayerIterator::Context::NextPos() {
+ ASSERT(HasMorePos());
+ return Context(layer_->posZOrderList()->at(next_pos_++));
+}
+
+//
+// StackingOrderIterator
+//
+
+StackingOrderIterator::StackingOrderIterator() {
+ Reset(NULL);
+}
+
+void StackingOrderIterator::Reset(WebCore::RenderLayer* rl) {
+ layer_iterator_.Reset(rl);
+ current_object_ = NULL;
+ current_layer_root_ = NULL;
+}
+
+WebCore::RenderObject* StackingOrderIterator::Next() {
+ if (current_object_) {
+ // Get the next object inside the current layer.
+ current_object_ = current_object_->nextInPreOrder(current_layer_root_);
+
+ // Skip any sub-layers we encounter along the way; they are
+ // visited (in the correct stacking order) by layer_iterator_.
+ while (current_object_ && current_object_->hasLayer()) {
+ current_object_ = current_object_->
+ nextInPreOrderAfterChildren(current_layer_root_);
+ }
+ }
+
+ if (!current_object_) {
+ // Start the next layer.
+ WebCore::RenderLayer* layer = layer_iterator_.Next();
+ if (layer) {
+ current_object_ = layer->renderer();
+ current_layer_root_ = current_object_;
+ }
+ // No more layers.
+ }
+ return current_object_;
+}
diff --git a/webkit/glue/stacking_order_iterator.h b/webkit/glue/stacking_order_iterator.h
new file mode 100755
index 0000000..20dea41
--- /dev/null
+++ b/webkit/glue/stacking_order_iterator.h
@@ -0,0 +1,73 @@
+// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Provides some utilities for iterating over a RenderObject graph in
+// stacking order.
+
+#ifndef WEBKIT_GLUE_STACKING_ORDER_ITERATOR_H__
+#define WEBKIT_GLUE_STACKING_ORDER_ITERATOR_H__
+
+#include <vector>
+
+namespace WebCore {
+class RenderLayer;
+class RenderObject;
+}
+
+// Iterates over a subtree of RenderLayers in stacking order, back to
+// front. Modifying the RenderObject graph invalidates this iterator.
+//
+// TODO(tulrich): this could go in webkit.
+// TODO(tulrich): needs unittests.
+class RenderLayerIterator {
+ public:
+ RenderLayerIterator();
+
+ // Sets the RenderLayer subtree to iterate over.
+ void Reset(WebCore::RenderLayer* rl);
+
+ // Returns the next RenderLayer in stacking order, back to front.
+ WebCore::RenderLayer* Next();
+ private:
+ class Context {
+ public:
+ Context(WebCore::RenderLayer* layer);
+
+ bool HasMoreNeg();
+ Context NextNeg();
+ bool HasSelf();
+ WebCore::RenderLayer* NextSelf();
+ bool HasMoreOverflow();
+ Context NextOverflow();
+ bool HasMorePos();
+ Context NextPos();
+
+ private:
+ WebCore::RenderLayer* layer_;
+ size_t next_neg_;
+ size_t next_self_;
+ size_t next_overflow_;
+ size_t next_pos_;
+ };
+
+ std::vector<Context> context_stack_;
+};
+
+// Iterates over a subtree of RenderObjects below a given RenderLayer.
+//
+// TODO(tulrich): this could go in webkit.
+// TODO(tulrich): needs unittests.
+class StackingOrderIterator {
+ public:
+ StackingOrderIterator();
+ void Reset(WebCore::RenderLayer* rl);
+ WebCore::RenderObject* Next();
+
+ private:
+ RenderLayerIterator layer_iterator_;
+ WebCore::RenderObject* current_object_;
+ WebCore::RenderObject* current_layer_root_;
+};
+
+#endif // WEBKIT_GLUE_STACKING_ORDER_ITERATOR_H__
diff --git a/webkit/glue/webcursor.cc b/webkit/glue/webcursor.cc
index c00d0d4..cccb3a0 100644
--- a/webkit/glue/webcursor.cc
+++ b/webkit/glue/webcursor.cc
@@ -6,7 +6,7 @@
#include "webkit/glue/webkit_resources.h"
#if PLATFORM(WIN)
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#endif
WebCursor::WebCursor()
diff --git a/webkit/glue/webplugin.h b/webkit/glue/webplugin.h
index 5cbf9a9..b704153 100644
--- a/webkit/glue/webplugin.h
+++ b/webkit/glue/webplugin.h
@@ -56,7 +56,10 @@ struct WebPluginInfo {
struct WebPluginGeometry {
HWND window;
gfx::Rect window_rect;
+ // Clip rect (include) and cutouts (excludes), relative to
+ // window_rect origin.
gfx::Rect clip_rect;
+ std::vector<gfx::Rect> cutout_rects;
bool visible;
};
diff --git a/webkit/glue/webplugin_delegate.h b/webkit/glue/webplugin_delegate.h
index 40419bd..df5716a 100644
--- a/webkit/glue/webplugin_delegate.h
+++ b/webkit/glue/webplugin_delegate.h
@@ -6,6 +6,7 @@
#define WEBKIT_GLUE_WEBPLUGIN_DELEGATE_H__
#include <string>
+#include <vector>
#include "base/basictypes.h"
#include "base/gfx/native_widget_types.h"
@@ -42,12 +43,17 @@ class WebPluginDelegate {
// methods on the WebPlugin again.
virtual void PluginDestroyed() = 0;
- // Update the geometry of the plugin. This is a request to move the plugin,
- // relative to its containing window, to the coords given by window_rect.
- // Its contents should be clipped to the coords given by clip_rect, which are
- // relative to the origin of the plugin window.
+ // Update the geometry of the plugin. This is a request to move the
+ // plugin, relative to its containing window, to the coords given by
+ // window_rect. Its contents should be clipped to the coords given
+ // by clip_rect, which are relative to the origin of the plugin
+ // window. It's contents should also not overlap the given cutout
+ // rects. The clip_rect and cutout_rects are in plugin-relative
+ // coordinates.
virtual void UpdateGeometry(const gfx::Rect& window_rect,
- const gfx::Rect& clip_rect, bool visible) = 0;
+ const gfx::Rect& clip_rect,
+ const std::vector<gfx::Rect>& cutout_rects,
+ bool visible) = 0;
// Tells the plugin to paint the damaged rect. The HDC is only used for
// windowless plugins.
diff --git a/webkit/glue/webplugin_impl.cc b/webkit/glue/webplugin_impl.cc
index 996d6db..b81458c 100644
--- a/webkit/glue/webplugin_impl.cc
+++ b/webkit/glue/webplugin_impl.cc
@@ -17,7 +17,8 @@
#include "FrameTree.h"
#include "FrameView.h"
#include "GraphicsContext.h"
-#include "HTMLPlugInElement.h"
+#include "HTMLNames.h"
+#include "HTMLPluginElement.h"
#include "IntRect.h"
#include "KURL.h"
#include "KeyboardEvent.h"
@@ -46,6 +47,7 @@
#include "webkit/glue/webplugin_impl.h"
#include "webkit/glue/plugins/plugin_host.h"
#include "webkit/glue/plugins/plugin_instance.h"
+#include "webkit/glue/stacking_order_iterator.h"
#include "webkit/glue/webview_impl.h"
#include "googleurl/src/gurl.h"
#include "webkit/port/platform/Cursor.h"
@@ -179,6 +181,11 @@ void WebPluginContainer::detachFromWindow() {
hide();
}
+void WebPluginContainer::windowCutoutRects(WTF::Vector<WebCore::IntRect>*
+ cutouts) const {
+ impl_->windowCutoutRects(cutouts);
+}
+
void WebPluginContainer::didReceiveResponse(
const WebCore::ResourceResponse& response) {
@@ -530,6 +537,36 @@ WebCore::IntRect WebPluginImpl::windowClipRect() const {
return clip_rect;
}
+void WebPluginImpl::windowCutoutRects(
+ WTF::Vector<WebCore::IntRect>* cutouts) const {
+ WebCore::RenderObject* plugin_node = element_->renderer();
+ ASSERT(plugin_node);
+
+ // Find all iframes that stack higher than this plugin.
+ bool higher = false;
+ StackingOrderIterator iterator;
+ WebCore::RenderLayer* root = element_->document()->renderer()->
+ enclosingLayer();
+ iterator.Reset(root);
+
+ while (WebCore::RenderObject* ro = iterator.Next()) {
+ if (ro == plugin_node) {
+ // All nodes after this one are higher than plugin.
+ higher = true;
+ } else if (higher) {
+ // Is this a visible iframe?
+ WebCore::Node* n = ro->node();
+ if (n && n->hasTagName(WebCore::HTMLNames::iframeTag)) {
+ if (!ro->style() || ro->style()->visibility() == WebCore::VISIBLE) {
+ int x, y;
+ ro->absolutePosition(x, y);
+ cutouts->append(WebCore::IntRect(x, y, ro->width(), ro->height()));
+ }
+ }
+ }
+ }
+}
+
void WebPluginImpl::geometryChanged() const {
if (!widget_)
return;
@@ -538,7 +575,7 @@ void WebPluginImpl::geometryChanged() const {
// our parent view was scrolled.
const_cast<WebPluginImpl*>(this)->widget_->setFrameGeometry(
widget_->frameGeometry());
- }
+}
void WebPluginImpl::setFrameGeometry(const WebCore::IntRect& rect) {
// Compute a new position and clip rect for ourselves relative to the
@@ -564,7 +601,8 @@ void WebPluginImpl::setFrameGeometry(const WebCore::IntRect& rect) {
WebCore::IntRect window_rect;
WebCore::IntRect clip_rect;
- CalculateBounds(rect, &window_rect, &clip_rect);
+ std::vector<gfx::Rect> cutout_rects;
+ CalculateBounds(rect, &window_rect, &clip_rect, &cutout_rects);
if (window_ && received_first_paint_notification_) {
// Let the WebViewDelegate know that the plugin window needs to be moved,
@@ -573,12 +611,14 @@ void WebPluginImpl::setFrameGeometry(const WebCore::IntRect& rect) {
move.window = window_;
move.window_rect = gfx::Rect(window_rect);
move.clip_rect = gfx::Rect(clip_rect);
+ move.cutout_rects = cutout_rects;
move.visible = visible_;
+
webview->delegate()->DidMove(webview, move);
}
delegate_->UpdateGeometry(
- gfx::Rect(window_rect), gfx::Rect(clip_rect),
+ gfx::Rect(window_rect), gfx::Rect(clip_rect), cutout_rects,
received_first_paint_notification_? visible_ : false);
// delegate_ can go away as a result of above call, so check it first.
@@ -613,11 +653,13 @@ void WebPluginImpl::paint(WebCore::GraphicsContext* gc,
if (!windowless_) {
WebCore::IntRect window_rect;
WebCore::IntRect clip_rect;
+ std::vector<gfx::Rect> cutout_rects;
- CalculateBounds(widget_->frameGeometry(), &window_rect, &clip_rect);
+ CalculateBounds(widget_->frameGeometry(), &window_rect, &clip_rect,
+ &cutout_rects);
delegate_->UpdateGeometry(gfx::Rect(window_rect), gfx::Rect(clip_rect),
- visible_);
+ cutout_rects, visible_);
delegate_->FlushGeometryUpdates();
}
}
@@ -997,7 +1039,8 @@ WebCore::ScrollView* WebPluginImpl::parent() const {
void WebPluginImpl::CalculateBounds(const WebCore::IntRect& frame_rect,
WebCore::IntRect* window_rect,
- WebCore::IntRect* clip_rect) {
+ WebCore::IntRect* clip_rect,
+ std::vector<gfx::Rect>* cutout_rects) {
DCHECK(parent()->isFrameView());
WebCore::FrameView* view = static_cast<WebCore::FrameView*>(parent());
@@ -1007,6 +1050,16 @@ void WebPluginImpl::CalculateBounds(const WebCore::IntRect& frame_rect,
// Calculate a clip-rect so that we don't overlap the scrollbars, etc.
*clip_rect = widget_->windowClipRect();
clip_rect->move(-window_rect->x(), -window_rect->y());
+
+ cutout_rects->clear();
+ WTF::Vector<WebCore::IntRect> rects;
+ widget_->windowCutoutRects(&rects);
+ // Convert to gfx::Rect and subtract out the plugin position.
+ for (size_t i = 0; i < rects.size(); i++) {
+ gfx::Rect r(rects[i]);
+ r.Offset(-frame_rect.x(), -frame_rect.y());
+ cutout_rects->push_back(r);
+ }
}
void WebPluginImpl::HandleURLRequest(const char *method,
diff --git a/webkit/glue/webplugin_impl.h b/webkit/glue/webplugin_impl.h
index b7a4dab..781369e 100644
--- a/webkit/glue/webplugin_impl.h
+++ b/webkit/glue/webplugin_impl.h
@@ -15,6 +15,7 @@
#include "ResourceHandleClient.h"
#include "ResourceRequest.h"
#include "Widget.h"
+#include "Vector.h"
#pragma warning(pop)
#include "base/basictypes.h"
@@ -64,6 +65,13 @@ class WebPluginContainer : public WebCore::Widget {
virtual void attachToWindow();
virtual void detachFromWindow();
+ // Returns window-relative rectangles that should clip this widget.
+ // Use this to implement iframe shim behavior.
+ //
+ // TODO(tulrich): add this method to WebCore/platform/Widget.h so it
+ // can be used by any platform.
+ void windowCutoutRects(WTF::Vector<WebCore::IntRect>* cutouts) const;
+
// These methods are invoked from webkit when it has data to be sent to the
// plugin. The plugin in this case does not initiate a download for the data.
void didReceiveResponse(const WebCore::ResourceResponse& response);
@@ -176,6 +184,13 @@ class WebPluginImpl : public WebPlugin,
virtual WebCore::IntRect windowClipRect() const;
virtual void geometryChanged() const;
+ // Returns window-relative rectangles that should clip this widget.
+ // Use this to implement iframe shim behavior.
+ //
+ // TODO(tulrich): windowCutoutRects() is not in WebCore::Widgets
+ // yet; need to add it.
+ void windowCutoutRects(WTF::Vector<WebCore::IntRect>* rects) const;
+
// Override for when our window changes size or position.
// Used to notify the plugin when the size or position changes.
virtual void setFrameGeometry(const WebCore::IntRect& rect);
@@ -235,7 +250,8 @@ class WebPluginImpl : public WebPlugin,
// Calculates the bounds of the plugin widget based on the frame rect passed in.
void CalculateBounds(const WebCore::IntRect& frame_rect,
WebCore::IntRect* window_rect,
- WebCore::IntRect* clip_rect);
+ WebCore::IntRect* clip_rect,
+ std::vector<gfx::Rect>* cutout_rects);
void HandleURLRequest(const char *method,
bool is_javascript_url,
diff --git a/webkit/port/platform/graphics/ImageSkia.cpp b/webkit/port/platform/graphics/ImageSkia.cpp
index 1989eba8..2c5911c 100644
--- a/webkit/port/platform/graphics/ImageSkia.cpp
+++ b/webkit/port/platform/graphics/ImageSkia.cpp
@@ -44,7 +44,7 @@
#include "SkiaUtils.h"
#include "SkShader.h"
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#include "base/gfx/image_operations.h"
#include "base/gfx/native_theme.h"
#include "base/gfx/platform_canvas_win.h"
diff --git a/webkit/port/platform/graphics/SkiaUtils.cpp b/webkit/port/platform/graphics/SkiaUtils.cpp
index 4e1e5b5..422f24a 100644
--- a/webkit/port/platform/graphics/SkiaUtils.cpp
+++ b/webkit/port/platform/graphics/SkiaUtils.cpp
@@ -39,7 +39,7 @@
#include "base/basictypes.h"
#if defined(OS_WIN)
-#include "base/gfx/bitmap_header.h"
+#include "base/gfx/gdi_util.h"
#endif
void WebCorePointToSkiaPoint(const WebCore::FloatPoint& src, SkPoint* dst)
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index f7cc828..844182e 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -759,7 +759,8 @@ void TestWebViewDelegate::GetRootWindowRect(WebWidget* webwidget,
void TestWebViewDelegate::DidMove(WebWidget* webwidget,
const WebPluginGeometry& move) {
WebPluginDelegateImpl::MoveWindow(
- move.window, move.window_rect, move.clip_rect, move.visible);
+ move.window, move.window_rect, move.clip_rect, move.cutout_rects,
+ move.visible);
}
void TestWebViewDelegate::RunModal(WebWidget* webwidget) {