diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-13 18:40:10 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-13 18:40:10 +0000 |
commit | 2fb6d466842f445078962a2f5aa4fa7af49d2313 (patch) | |
tree | 5c0a8fa678d4a36bb89a61f773f32b6ea5c7d8f0 /chrome/browser/views/constrained_window_impl.cc | |
parent | 830e2069f5c67d74cd4f2720438ea6a9609994c3 (diff) | |
download | chromium_src-2fb6d466842f445078962a2f5aa4fa7af49d2313.zip chromium_src-2fb6d466842f445078962a2f5aa4fa7af49d2313.tar.gz chromium_src-2fb6d466842f445078962a2f5aa4fa7af49d2313.tar.bz2 |
Make system menus show up at the right place for all frames, whether they're triggered by clicking the window icon or hitting alt-space. Make clicking the icon for windows without a non-client view (e.g. the Bookmark Manager on Aero Glass) bring up the system menu.
Clean up more dead code, verbose code, or unnecessary statics/members.
TEST=Right-click titlebars, hit alt-space, and left-click window icons (where present), for:
* Main window
* Dialogs, e.g. the bookmark manager
* Popups
* App windows
When right-clicking, a system menu should appear at the cursor. For the other cases, a system menu should appear at the system native location (roughly just below the titlebar).
Review URL: http://codereview.chromium.org/20225
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9766 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/constrained_window_impl.cc')
-rw-r--r-- | chrome/browser/views/constrained_window_impl.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index 3c1d78f..207ee31 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -201,7 +201,7 @@ class ConstrainedWindowNonClientView virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; virtual gfx::Size CalculateWindowSizeForClientSize(int width, int height) const; - virtual CPoint GetSystemMenuPoint() 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); @@ -353,10 +353,13 @@ gfx::Size ConstrainedWindowNonClientView::CalculateWindowSizeForClientSize( 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. - return CPoint(); +gfx::Point ConstrainedWindowNonClientView::GetSystemMenuPoint() const { + // Doesn't really matter, since we never show system menus on constrained + // windows... + gfx::Point system_menu_point(FrameBorderThickness(), + NonClientTopBorderHeight()); + ConvertPointToScreen(this, &system_menu_point); + return system_menu_point; } int ConstrainedWindowNonClientView::NonClientHitTest(const gfx::Point& point) { |