summaryrefslogtreecommitdiffstats
path: root/chrome/views/hwnd_view.cc
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-16 18:17:47 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-16 18:17:47 +0000
commit80f8b9f5cf620c37e9d1408a114dc90699584d89 (patch)
tree9e2f5fcacbb18cd86690bc47e0d22ea8f10ac317 /chrome/views/hwnd_view.cc
parentf377cebc8bb25bb9f6708adbfda567a95c296642 (diff)
downloadchromium_src-80f8b9f5cf620c37e9d1408a114dc90699584d89.zip
chromium_src-80f8b9f5cf620c37e9d1408a114dc90699584d89.tar.gz
chromium_src-80f8b9f5cf620c37e9d1408a114dc90699584d89.tar.bz2
Make View::SetBounds take a const gfx::Rect& instead of a const CRect&
Make View::DidChangeBounds call Layout by default, eliminating this function from most places. http://crbug.com/2186 Review URL: http://codereview.chromium.org/7429 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/hwnd_view.cc')
-rw-r--r--chrome/views/hwnd_view.cc19
1 files changed, 9 insertions, 10 deletions
diff --git a/chrome/views/hwnd_view.cc b/chrome/views/hwnd_view.cc
index 6c66851..d6976a3 100644
--- a/chrome/views/hwnd_view.cc
+++ b/chrome/views/hwnd_view.cc
@@ -77,8 +77,7 @@ void HWNDView::UpdateHWNDBounds() {
bool visible = !vis_bounds.IsEmpty();
if (visible && !fast_resize_) {
- if (vis_bounds.width() != bounds_.Width() ||
- vis_bounds.height() != bounds_.Height()) {
+ if (vis_bounds.size() != size()) {
// Only a portion of the HWND is really visible.
int x = vis_bounds.x();
int y = vis_bounds.y();
@@ -114,14 +113,12 @@ void HWNDView::UpdateHWNDBounds() {
::SetWindowPos(hwnd_, 0, top_left.x(), top_left.y(), rect.Width(),
rect.Height(), swp_flags);
- HRGN clip_region = CreateRectRgn(0, 0,
- bounds_.Width(),
- bounds_.Height());
+ HRGN clip_region = CreateRectRgn(0, 0, width(), height());
SetWindowRgn(hwnd_, clip_region, FALSE);
installed_clip_ = true;
} else {
- ::SetWindowPos(hwnd_, 0, top_left.x(), top_left.y(), bounds_.Width(),
- bounds_.Height(), swp_flags);
+ ::SetWindowPos(hwnd_, 0, top_left.x(), top_left.y(), width(), height(),
+ swp_flags);
}
} else if (::IsWindowVisible(hwnd_)) {
// The window is currently visible, but its clipped by another view. Hide
@@ -132,7 +129,10 @@ void HWNDView::UpdateHWNDBounds() {
}
}
-void HWNDView::DidChangeBounds(const CRect& previous, const CRect& current) {
+void HWNDView::DidChangeBounds(const gfx::Rect& previous,
+ const gfx::Rect& current) {
+ // TODO(beng): (Cleanup) Could UpdateHWNDBounds be replaced by a Layout
+ // method and this function gotten rid of?
UpdateHWNDBounds();
}
@@ -183,8 +183,7 @@ void HWNDView::Paint(ChromeCanvas* canvas) {
// It would be nice if this used some approximation of the page's
// current background color.
if (installed_clip_ && win_util::ShouldUseVistaFrame())
- canvas->FillRectInt(SkColorSetRGB(255, 255, 255), 0, 0,
- bounds_.Width(), bounds_.Height());
+ canvas->FillRectInt(SkColorSetRGB(255, 255, 255), 0, 0, width(), height());
}
std::string HWNDView::GetClassName() const {