summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/win_util.cc3
-rw-r--r--base/scoped_handle_win.h3
-rw-r--r--chrome/browser/aeropeek_manager.cc3
-rw-r--r--chrome/browser/ui/tabs/dock_info_win.cc2
-rw-r--r--chrome/browser/ui/views/dropdown_bar_host.cc25
-rw-r--r--chrome/browser/ui/views/status_icons/status_icon_win.h4
-rw-r--r--views/view.cc5
7 files changed, 28 insertions, 17 deletions
diff --git a/app/win_util.cc b/app/win_util.cc
index b3a0571..0bbe391 100644
--- a/app/win_util.cc
+++ b/app/win_util.cc
@@ -24,6 +24,7 @@
#include "base/scoped_handle_win.h"
#include "base/string_util.h"
#include "base/win_util.h"
+#include "base/win/scoped_gdi_object.h"
#include "base/win/windows_version.h"
#include "gfx/codec/png_codec.h"
#include "gfx/gdi_util.h"
@@ -548,7 +549,7 @@ gfx::Font GetWindowTitleFont() {
NONCLIENTMETRICS ncm;
win_util::GetNonClientMetrics(&ncm);
l10n_util::AdjustUIFont(&(ncm.lfCaptionFont));
- ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
+ base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
return gfx::Font(caption_font);
}
diff --git a/base/scoped_handle_win.h b/base/scoped_handle_win.h
index 09bb2cb..8654ae0 100644
--- a/base/scoped_handle_win.h
+++ b/base/scoped_handle_win.h
@@ -13,7 +13,4 @@
using base::win::ScopedBitmap;
using base::win::ScopedHandle;
using base::win::ScopedHDC;
-using base::win::ScopedHFONT;
using base::win::ScopedHGlobal;
-using base::win::ScopedHICON;
-using base::win::ScopedRegion;
diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc
index 9273cd2..eb5e8bf 100644
--- a/chrome/browser/aeropeek_manager.cc
+++ b/chrome/browser/aeropeek_manager.cc
@@ -13,6 +13,7 @@
#include "base/scoped_handle_win.h"
#include "base/scoped_native_library.h"
#include "base/waitable_event.h"
+#include "base/win/scoped_gdi_object.h"
#include "base/win/windows_version.h"
#include "chrome/browser/app_icon_win.h"
#include "chrome/browser/browser_list.h"
@@ -682,7 +683,7 @@ class AeroPeekWindow : public gfx::WindowImpl {
// The favicon for this tab.
SkBitmap favicon_bitmap_;
- ScopedHICON favicon_;
+ base::win::ScopedHICON favicon_;
// The icon used by the frame window.
// This icon is used when this tab doesn't have a favicon.
diff --git a/chrome/browser/ui/tabs/dock_info_win.cc b/chrome/browser/ui/tabs/dock_info_win.cc
index dee78cf..5e59ce5 100644
--- a/chrome/browser/ui/tabs/dock_info_win.cc
+++ b/chrome/browser/ui/tabs/dock_info_win.cc
@@ -129,7 +129,7 @@ class TopMostFinder : public BaseWindowFinder {
// in ShouldStopIterating if target_ is passed in.
bool is_top_most_;
- ScopedRegion tmp_region_;
+ base::win::ScopedRegion tmp_region_;
DISALLOW_COPY_AND_ASSIGN(TopMostFinder);
};
diff --git a/chrome/browser/ui/views/dropdown_bar_host.cc b/chrome/browser/ui/views/dropdown_bar_host.cc
index f3367d2..1134c8c 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()));
}
diff --git a/chrome/browser/ui/views/status_icons/status_icon_win.h b/chrome/browser/ui/views/status_icons/status_icon_win.h
index 74c3742..6bbda23 100644
--- a/chrome/browser/ui/views/status_icons/status_icon_win.h
+++ b/chrome/browser/ui/views/status_icons/status_icon_win.h
@@ -9,7 +9,7 @@
#include <windows.h>
#include <shellapi.h>
-#include "base/scoped_handle_win.h"
+#include "base/win/scoped_gdi_object.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/status_icons/status_icon.h"
@@ -54,7 +54,7 @@ class StatusIconWin : public StatusIcon {
UINT message_id_;
// The currently-displayed icon for the window.
- ScopedHICON icon_;
+ base::win::ScopedHICON icon_;
// Context menu associated with this icon (if any).
scoped_ptr<views::Menu2> context_menu_;
diff --git a/views/view.cc b/views/view.cc
index a33d5be..96dfdf1 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -12,7 +12,6 @@
#include "app/drag_drop_types.h"
#include "base/logging.h"
#include "base/message_loop.h"
-#include "base/scoped_handle.h"
#include "base/utf_string_conversions.h"
#include "gfx/canvas_skia.h"
#include "gfx/path.h"
@@ -26,6 +25,7 @@
#include "views/window/window.h"
#if defined(OS_WIN)
+#include "base/win/scoped_gdi_object.h"
#include "views/accessibility/view_accessibility.h"
#endif
#if defined(OS_LINUX)
@@ -450,11 +450,12 @@ bool View::HitTest(const gfx::Point& l) const {
if (HasHitTestMask()) {
gfx::Path mask;
GetHitTestMask(&mask);
- ScopedRegion rgn(mask.CreateNativeRegion());
// TODO: can this use SkRegion's contains instead?
#if defined(OS_WIN)
+ base::win::ScopedRegion rgn(mask.CreateNativeRegion());
return !!PtInRegion(rgn, l.x(), l.y());
#elif defined(TOOLKIT_USES_GTK)
+ ScopedRegion rgn(mask.CreateNativeRegion());
return gdk_region_point_in(rgn.Get(), l.x(), l.y());
#endif
}