diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 05:02:43 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 05:02:43 +0000 |
commit | 1255a3e4bb4f30978c79497e4f05db615e197505 (patch) | |
tree | d1575c5c0ae3672dd379d6d67838c673b4d7824e /chrome/browser/views/frame | |
parent | 5ce3da1ef045e25ef4c34cfc925fb8a48ad2e87c (diff) | |
download | chromium_src-1255a3e4bb4f30978c79497e4f05db615e197505.zip chromium_src-1255a3e4bb4f30978c79497e4f05db615e197505.tar.gz chromium_src-1255a3e4bb4f30978c79497e4f05db615e197505.tar.bz2 |
Support app menu and double-click close on upper left corner of window, part one.
This makes things work right for windows that have an icon. The behavior of the main window is unchanged because right now it never returns HTSYSMENU anywhere. Part two of this change will be figuring out how to return that at the right place, which will make things Just Work.
BUG=6961
TEST=Open an app or popup window. Single click the icon. The app menu should appear. Close it, then click-and-drag into the app menu. The item you release on should execute. Double-click the icon. The window should close.
Review URL: http://codereview.chromium.org/577018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38187 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame')
7 files changed, 5 insertions, 51 deletions
diff --git a/chrome/browser/views/frame/app_panel_browser_frame_view.cc b/chrome/browser/views/frame/app_panel_browser_frame_view.cc index d8a67c5..0fee915 100755 --- a/chrome/browser/views/frame/app_panel_browser_frame_view.cc +++ b/chrome/browser/views/frame/app_panel_browser_frame_view.cc @@ -153,15 +153,6 @@ gfx::Rect AppPanelBrowserFrameView::GetWindowBoundsForClientBounds( client_bounds.height() + top_height + border_thickness); } -gfx::Point AppPanelBrowserFrameView::GetSystemMenuPoint() const { - gfx::Point system_menu_point( - MirroredXCoordinateInsideView(FrameBorderThickness()), - NonClientTopBorderHeight() + browser_view_->GetTabStripHeight() - - kClientEdgeThickness); - ConvertPointToScreen(this, &system_menu_point); - return system_menu_point; -} - int AppPanelBrowserFrameView::NonClientHitTest(const gfx::Point& point) { if (!bounds().Contains(point)) return HTNOWHERE; diff --git a/chrome/browser/views/frame/app_panel_browser_frame_view.h b/chrome/browser/views/frame/app_panel_browser_frame_view.h index 6476ee8..5530806 100755 --- a/chrome/browser/views/frame/app_panel_browser_frame_view.h +++ b/chrome/browser/views/frame/app_panel_browser_frame_view.h @@ -44,7 +44,6 @@ class AppPanelBrowserFrameView : public BrowserNonClientFrameView, virtual bool AlwaysUseNativeFrame() const; virtual gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const; - virtual gfx::Point GetSystemMenuPoint() const; virtual int NonClientHitTest(const gfx::Point& point); virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); virtual void EnableClose(bool enable); diff --git a/chrome/browser/views/frame/browser_frame_gtk.cc b/chrome/browser/views/frame/browser_frame_gtk.cc index 2964566..bc219f0 100644 --- a/chrome/browser/views/frame/browser_frame_gtk.cc +++ b/chrome/browser/views/frame/browser_frame_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -37,11 +37,6 @@ class PopupNonClientFrameView : public BrowserNonClientFrameView { const gfx::Rect& client_bounds) const { return client_bounds; } - virtual gfx::Point GetSystemMenuPoint() const { - // Never used on GTK. - // TODO: make this method windows specific. - return gfx::Point(0, 0); - } virtual int NonClientHitTest(const gfx::Point& point) { return HTNOWHERE; } diff --git a/chrome/browser/views/frame/glass_browser_frame_view.cc b/chrome/browser/views/frame/glass_browser_frame_view.cc index 397a17f..f3f5f11 100644 --- a/chrome/browser/views/frame/glass_browser_frame_view.cc +++ b/chrome/browser/views/frame/glass_browser_frame_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -150,26 +150,6 @@ gfx::Rect GlassBrowserFrameView::GetWindowBoundsForClientBounds( client_bounds.height() + top_height + border_thickness); } -gfx::Point GlassBrowserFrameView::GetSystemMenuPoint() const { - views::Window* window = frame_->GetWindow(); - gfx::Point system_menu_point; - if (browser_view_->IsBrowserTypeNormal()) { - // The X coordinate conditional is because in maximized mode the frame edge - // and the client edge are both offscreen, whereas in the opaque frame - // (where we don't do this trick) maximized windows have no client edge and - // only the frame edge is offscreen. - system_menu_point.SetPoint(NonClientBorderThickness() - - ((window->IsMaximized() || window->IsFullscreen()) ? - 0 : kClientEdgeThickness), - NonClientTopBorderHeight() + browser_view_->GetTabStripHeight() - - (frame_->GetWindow()->IsFullscreen() ? 0 : kClientEdgeThickness)); - } else { - system_menu_point.SetPoint(0, -kFrameShadowThickness); - } - ConvertPointToScreen(this, &system_menu_point); - return system_menu_point; -} - int GlassBrowserFrameView::NonClientHitTest(const gfx::Point& point) { // If the browser isn't in normal mode, we haven't customized the frame, so // Windows can figure this out. If the point isn't within our bounds, then diff --git a/chrome/browser/views/frame/glass_browser_frame_view.h b/chrome/browser/views/frame/glass_browser_frame_view.h index ec0708f..f446ccc 100644 --- a/chrome/browser/views/frame/glass_browser_frame_view.h +++ b/chrome/browser/views/frame/glass_browser_frame_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -28,7 +28,6 @@ class GlassBrowserFrameView : public BrowserNonClientFrameView { virtual bool AlwaysUseNativeFrame() const; virtual gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const; - virtual gfx::Point GetSystemMenuPoint() const; virtual int NonClientHitTest(const gfx::Point& point); virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) { } virtual void EnableClose(bool enable) { } diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc index 321a8b9..aa1cb37 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.cc +++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -283,15 +283,6 @@ gfx::Rect OpaqueBrowserFrameView::GetWindowBoundsForClientBounds( client_bounds.height() + top_height + border_thickness); } -gfx::Point OpaqueBrowserFrameView::GetSystemMenuPoint() const { - gfx::Point system_menu_point( - MirroredXCoordinateInsideView(FrameBorderThickness()), - NonClientTopBorderHeight() + browser_view_->GetTabStripHeight() - - (frame_->GetWindow()->IsFullscreen() ? 0 : kClientEdgeThickness)); - ConvertPointToScreen(this, &system_menu_point); - return system_menu_point; -} - int OpaqueBrowserFrameView::NonClientHitTest(const gfx::Point& point) { if (!bounds().Contains(point)) return HTNOWHERE; diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h index 647d8ac..68845ec 100644 --- a/chrome/browser/views/frame/opaque_browser_frame_view.h +++ b/chrome/browser/views/frame/opaque_browser_frame_view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -43,7 +43,6 @@ class OpaqueBrowserFrameView : public BrowserNonClientFrameView, virtual bool AlwaysUseNativeFrame() const; virtual gfx::Rect GetWindowBoundsForClientBounds( const gfx::Rect& client_bounds) const; - virtual gfx::Point GetSystemMenuPoint() const; virtual int NonClientHitTest(const gfx::Point& point); virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); virtual void EnableClose(bool enable); |