summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 20:06:05 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-09 20:06:05 +0000
commit7debf7385682c5fcc4ab8e17b05148491944fb81 (patch)
treefafe7440dcb846d0d23fbed717857dcf2ed31f60 /chrome/browser
parent7f93717b442d05e12f90c69cd191fb6b7e9b7573 (diff)
downloadchromium_src-7debf7385682c5fcc4ab8e17b05148491944fb81.zip
chromium_src-7debf7385682c5fcc4ab8e17b05148491944fb81.tar.gz
chromium_src-7debf7385682c5fcc4ab8e17b05148491944fb81.tar.bz2
Use RECT instead of CRect to reduce dependencies on ATL.
BUG=5027 TEST=none Review URL: http://codereview.chromium.org/195036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25780 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/dock_info_win.cc28
-rw-r--r--chrome/browser/window_sizer_win.cc12
2 files changed, 16 insertions, 24 deletions
diff --git a/chrome/browser/dock_info_win.cc b/chrome/browser/dock_info_win.cc
index 8997659..9ae56ad 100644
--- a/chrome/browser/dock_info_win.cc
+++ b/chrome/browser/dock_info_win.cc
@@ -4,10 +4,6 @@
#include "chrome/browser/dock_info.h"
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlmisc.h>
-
#include "base/basictypes.h"
#include "base/logging.h"
#include "chrome/browser/browser.h"
@@ -28,7 +24,7 @@ namespace {
class BaseWindowFinder {
public:
// Creates a BaseWindowFinder with the specified set of HWNDs to ignore.
- BaseWindowFinder(const std::set<HWND>& ignore) : ignore_(ignore) {}
+ explicit BaseWindowFinder(const std::set<HWND>& ignore) : ignore_(ignore) {}
virtual ~BaseWindowFinder() {}
protected:
@@ -71,13 +67,13 @@ class TopMostFinder : public BaseWindowFinder {
return true;
}
- if (!::IsWindowVisible(hwnd)) {
+ if (!IsWindowVisible(hwnd)) {
// The window isn't visible, keep iterating.
return false;
}
- CRect r;
- if (!::GetWindowRect(hwnd, &r) || !r.PtInRect(screen_loc_.ToPOINT())) {
+ RECT r;
+ if (!GetWindowRect(hwnd, &r) || !PtInRect(&r, screen_loc_.ToPOINT())) {
// The window doesn't contain the point, keep iterating.
return false;
}
@@ -145,9 +141,9 @@ class LocalProcessWindowFinder : public BaseWindowFinder {
protected:
virtual bool ShouldStopIterating(HWND hwnd) {
- CRect r;
- if (::IsWindowVisible(hwnd) && ::GetWindowRect(hwnd, &r) &&
- r.PtInRect(screen_loc_.ToPOINT())) {
+ RECT r;
+ if (IsWindowVisible(hwnd) && GetWindowRect(hwnd, &r) &&
+ PtInRect(&r, screen_loc_.ToPOINT())) {
result_ = hwnd;
return true;
}
@@ -196,9 +192,9 @@ class DockToWindowFinder : public BaseWindowFinder {
protected:
virtual bool ShouldStopIterating(HWND hwnd) {
BrowserView* window = BrowserView::GetBrowserViewForNativeWindow(hwnd);
- CRect bounds;
- if (!window || !::IsWindowVisible(hwnd) ||
- !::GetWindowRect(hwnd, &bounds)) {
+ RECT bounds;
+ if (!window || !IsWindowVisible(hwnd) ||
+ !GetWindowRect(hwnd, &bounds)) {
return false;
}
@@ -310,6 +306,6 @@ void DockInfo::SizeOtherWindowTo(const gfx::Rect& bounds) const {
// window we're docking to isn't maximized.
ShowWindow(window(), SW_RESTORE | SW_SHOWNA);
}
- ::SetWindowPos(window(), HWND_TOP, bounds.x(), bounds.y(), bounds.width(),
- bounds.height(), SWP_NOACTIVATE | SWP_NOOWNERZORDER);
+ SetWindowPos(window(), HWND_TOP, bounds.x(), bounds.y(), bounds.width(),
+ bounds.height(), SWP_NOACTIVATE | SWP_NOOWNERZORDER);
}
diff --git a/chrome/browser/window_sizer_win.cc b/chrome/browser/window_sizer_win.cc
index 249af74..e4bd759 100644
--- a/chrome/browser/window_sizer_win.cc
+++ b/chrome/browser/window_sizer_win.cc
@@ -4,10 +4,6 @@
#include "chrome/browser/window_sizer.h"
-#include <atlbase.h>
-#include <atlapp.h>
-#include <atlmisc.h>
-
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
@@ -35,17 +31,17 @@ class DefaultMonitorInfoProvider : public WindowSizer::MonitorInfoProvider {
virtual gfx::Rect GetMonitorWorkAreaMatching(
const gfx::Rect& match_rect) const {
- CRect other_bounds_crect = match_rect.ToRECT();
+ RECT other_bounds_rect = match_rect.ToRECT();
MONITORINFO monitor_info = GetMonitorInfoForMonitor(MonitorFromRect(
- &other_bounds_crect, MONITOR_DEFAULTTONEAREST));
+ &other_bounds_rect, MONITOR_DEFAULTTONEAREST));
return gfx::Rect(monitor_info.rcWork);
}
virtual gfx::Point GetBoundsOffsetMatching(
const gfx::Rect& match_rect) const {
- CRect other_bounds_crect = match_rect.ToRECT();
+ RECT other_bounds_rect = match_rect.ToRECT();
MONITORINFO monitor_info = GetMonitorInfoForMonitor(MonitorFromRect(
- &other_bounds_crect, MONITOR_DEFAULTTONEAREST));
+ &other_bounds_rect, MONITOR_DEFAULTTONEAREST));
return gfx::Point(monitor_info.rcWork.left - monitor_info.rcMonitor.left,
monitor_info.rcWork.top - monitor_info.rcMonitor.top);
}