Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1755)

Unified Diff: chrome/browser/views/constrained_window_impl.cc

Issue 20161: Make aero glass code look more like other nonclient views in hopes of easing ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/views/frame/aero_glass_frame.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/constrained_window_impl.cc
===================================================================
--- chrome/browser/views/constrained_window_impl.cc (revision 9393)
+++ chrome/browser/views/constrained_window_impl.cc (working copy)
@@ -199,8 +199,6 @@
// Overridden from views::NonClientView:
virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const;
- virtual gfx::Size CalculateWindowSizeForClientSize(int width,
- int height) const;
virtual CPoint GetSystemMenuPoint() const;
virtual int NonClientHitTest(const gfx::Point& point);
virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask);
@@ -210,7 +208,6 @@
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Layout();
- virtual gfx::Size GetPreferredSize();
virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child);
// Overridden from views::BaseButton::ButtonListener:
@@ -346,14 +343,6 @@
std::max(0, height - top_height - border_thickness));
}
-gfx::Size ConstrainedWindowNonClientView::CalculateWindowSizeForClientSize(
- int width,
- int height) const {
- int border_thickness = NonClientBorderThickness();
- return gfx::Size(width + (2 * border_thickness),
- height + NonClientTopBorderHeight() + border_thickness);
-}
-
CPoint ConstrainedWindowNonClientView::GetSystemMenuPoint() const {
// Doesn't matter what we return, since this is only used when the user clicks
// a window icon, and we never have an icon.
@@ -361,8 +350,9 @@
}
int ConstrainedWindowNonClientView::NonClientHitTest(const gfx::Point& point) {
- // First see if it's within the grow box area, since that overlaps the client
- // bounds.
+ if (!bounds().Contains(point))
+ return HTNOWHERE;
+
int frame_component = container_->client_view()->NonClientHitTest(point);
if (frame_component != HTNOWHERE)
return frame_component;
@@ -372,11 +362,10 @@
return HTCLOSE;
int window_component = GetHTComponentForFrame(point, FrameBorderThickness(),
- NonClientBorderThickness(), kResizeAreaCornerSize,
+ NonClientBorderThickness(), kResizeAreaCornerSize, kResizeAreaCornerSize,
container_->window_delegate()->CanResize());
// Fall back to the caption if no other component matches.
- return ((window_component == HTNOWHERE) && bounds().Contains(point)) ?
- HTCAPTION : window_component;
+ return (window_component == HTNOWHERE) ? HTCAPTION : window_component;
}
void ConstrainedWindowNonClientView::GetWindowMask(const gfx::Size& size,
@@ -421,14 +410,6 @@
LayoutClientView();
}
-gfx::Size ConstrainedWindowNonClientView::GetPreferredSize() {
- gfx::Size prefsize(container_->client_view()->GetPreferredSize());
- int border_thickness = NonClientBorderThickness();
- prefsize.Enlarge(2 * border_thickness,
- NonClientTopBorderHeight() + border_thickness);
- return prefsize;
-}
-
void ConstrainedWindowNonClientView::ViewHierarchyChanged(bool is_add,
View *parent,
View *child) {
« no previous file with comments | « no previous file | chrome/browser/views/frame/aero_glass_frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698