Index: chrome/browser/ui/views/dropdown_bar_host.cc |
diff --git a/chrome/browser/ui/views/dropdown_bar_host.cc b/chrome/browser/ui/views/dropdown_bar_host.cc |
index f3367d2faddf54175e6f7afa89f3bdbd4194d5fb..1134c8ca0a525cc6aed98319e395edd3598efe01 100644 |
--- a/chrome/browser/ui/views/dropdown_bar_host.cc |
+++ b/chrome/browser/ui/views/dropdown_bar_host.cc |
@@ -6,7 +6,6 @@ |
#include "app/keyboard_codes.h" |
#include "app/slide_animation.h" |
-#include "base/scoped_handle.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/view_ids.h" |
#include "chrome/browser/ui/views/dropdown_bar_view.h" |
@@ -17,10 +16,22 @@ |
#include "views/focus/view_storage.h" |
#include "views/widget/widget.h" |
-#if defined(OS_LINUX) |
+#if defined(OS_WIN) |
+#include "base/win/scoped_gdi_object.h" |
+#elif defined(OS_LINUX) |
#include "app/scoped_handle_gtk.h" |
#endif |
+namespace { |
+ |
+#if defined(OS_WIN) |
+typedef base::win::ScopedRegion ScopedPlatformRegion; |
+#elif defined(OS_LINUX) |
+typedef ScopedRegion ScopedPlatformRegion; |
+#endif |
+ |
+} // namespace |
+ |
using gfx::Path; |
// static |
@@ -212,8 +223,7 @@ void DropdownBarHost::UpdateWindowEdges(const gfx::Rect& new_pos) { |
// We then create the polygon and use SetWindowRgn to force the window to draw |
// only within that area. This region may get reduced in size below. |
Path path(polygon, arraysize(polygon)); |
- ScopedRegion region(path.CreateNativeRegion()); |
- |
+ ScopedPlatformRegion region(path.CreateNativeRegion()); |
// Are we animating? |
if (animation_offset() > 0) { |
// The animation happens in two steps: First, we clip the window and then in |
@@ -231,7 +241,8 @@ void DropdownBarHost::UpdateWindowEdges(const gfx::Rect& new_pos) { |
SkRect animation_rect = { SkIntToScalar(0), SkIntToScalar(y), |
SkIntToScalar(max_x), SkIntToScalar(max_y) }; |
animation_path.addRect(animation_rect); |
- ScopedRegion animation_region(animation_path.CreateNativeRegion()); |
+ ScopedPlatformRegion animation_region( |
+ animation_path.CreateNativeRegion()); |
region.Set(Path::IntersectRegions(animation_region.Get(), region.Get())); |
// Next, we need to increase the region a little bit to account for the |
@@ -246,7 +257,7 @@ void DropdownBarHost::UpdateWindowEdges(const gfx::Rect& new_pos) { |
// Combine the region for the curve on the left with our main region. |
Path left_path(left_curve, arraysize(left_curve)); |
- ScopedRegion r(left_path.CreateNativeRegion()); |
+ ScopedPlatformRegion r(left_path.CreateNativeRegion()); |
region.Set(Path::CombineRegions(r.Get(), region.Get())); |
// Combine the region for the curve on the right with our main region. |
@@ -284,7 +295,7 @@ void DropdownBarHost::UpdateWindowEdges(const gfx::Rect& new_pos) { |
// Subtract this region from the original region. |
gfx::Path exclude_path(exclude, arraysize(exclude)); |
- ScopedRegion exclude_region(exclude_path.CreateNativeRegion()); |
+ ScopedPlatformRegion exclude_region(exclude_path.CreateNativeRegion()); |
region.Set(Path::SubtractRegion(region.Get(), exclude_region.Get())); |
} |