summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 02:51:34 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-04 02:51:34 +0000
commit847dda8ade71638fae9596d4b5102667c29fad1e (patch)
tree961773bbd2b5645cb129869f2ed0f7a50b63c9d6 /chrome/browser
parentb01a2c21bfaa8d4a64efa648e3637d9d3c0d3bb1 (diff)
downloadchromium_src-847dda8ade71638fae9596d4b5102667c29fad1e.zip
chromium_src-847dda8ade71638fae9596d4b5102667c29fad1e.tar.gz
chromium_src-847dda8ade71638fae9596d4b5102667c29fad1e.tar.bz2
Fix regression where the window caption buttons weren't clickable when maximized. This is because of the nonclient frameview/clientview hierarchy changes.
Make sure that the frame gets a chance to respond to GetViewForPoint before the client view if the client view does not visually overlap. http://crbug.com/8312 Review URL: http://codereview.chromium.org/40062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10857 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/views/frame/opaque_browser_frame_view.cc28
-rw-r--r--chrome/browser/views/frame/opaque_browser_frame_view.h3
2 files changed, 14 insertions, 17 deletions
diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc
index a908d7f..4e45151 100644
--- a/chrome/browser/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc
@@ -565,21 +565,19 @@ void OpaqueBrowserFrameView::Layout() {
LayoutClientView();
}
-views::View* OpaqueBrowserFrameView::GetViewForPoint(const gfx::Point& point,
- bool can_create_floating) {
- // We override this function because the ClientView can overlap the non -
- // client view, making it impossible to click on the window controls. We need
- // to ensure the window controls are checked _first_.
- views::View* views[] =
- { close_button_, restore_button_, maximize_button_, minimize_button_ };
- for (int i = 0; i < arraysize(views); ++i) {
- if (!views[i]->IsVisible())
- continue;
- // Apply mirroring transformation on view bounds for RTL chrome.
- if (views[i]->GetBounds(APPLY_MIRRORING_TRANSFORMATION).Contains(point))
- return views[i];
- }
- return View::GetViewForPoint(point, can_create_floating);
+bool OpaqueBrowserFrameView::HitTest(const gfx::Point& l) const {
+ // If the point is outside the bounds of the client area, claim it.
+ bool in_nonclient = NonClientFrameView::HitTest(l);
+ if (in_nonclient)
+ return in_nonclient;
+
+ // Otherwise claim it only if it's in a non-tab portion of the tabstrip.
+ if (l.y() > browser_view_->tabstrip()->bounds().bottom())
+ return false;
+
+ gfx::Point tabstrip_point(l);
+ View::ConvertPointToView(this, browser_view_->tabstrip(), &tabstrip_point);
+ return browser_view_->tabstrip()->PointIsWithinWindowCaption(tabstrip_point);
}
void OpaqueBrowserFrameView::ViewHierarchyChanged(bool is_add,
diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h
index 7eed20d..f25e4f4 100644
--- a/chrome/browser/views/frame/opaque_browser_frame_view.h
+++ b/chrome/browser/views/frame/opaque_browser_frame_view.h
@@ -46,8 +46,7 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView,
// Overridden from views::View:
virtual void Paint(ChromeCanvas* canvas);
virtual void Layout();
- virtual views::View* GetViewForPoint(const gfx::Point& point,
- bool can_create_floating);
+ virtual bool HitTest(const gfx::Point& l) const;
virtual void ViewHierarchyChanged(bool is_add,
views::View* parent,
views::View* child);