Skip to content
Snippets Groups Projects
Commit a684f124 authored by tfarina@chromium.org's avatar tfarina@chromium.org
Browse files

Remove more 'using' declarations of Scoped* from scoped_handle_win.h

BUG=None
TEST=trybots

Review URL: http://codereview.chromium.org/6040002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70286 0039d316-1c4b-4281-b951-d872f2087c98
parent 0bff6088
No related merge requests found
......@@ -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);
}
......
......@@ -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;
......@@ -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.
......
......@@ -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);
};
......
......@@ -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()));
}
......
......@@ -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_;
......
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment