A patch from external contributor Yong Shin (already in AUTHORS list). I also removed...
commit91115469ab00e0c314cf547e91e8b473890a90d2
authorfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 13 Feb 2009 17:45:37 +0000 (13 17:45 +0000)
committerfinnur@google.com <finnur@google.com@0039d316-1c4b-4281-b951-d872f2087c98>
Fri, 13 Feb 2009 17:45:37 +0000 (13 17:45 +0000)
tree57ff80f83a53baecfac4e1d84ae28b92b65a0e21
parentb6296fd565932f1362d32d6d5955e772d39c066f
A patch from external contributor Yong Shin (already in AUTHORS list). I also removed some lint errors. This was reviewed by me and Scott

TBR=sky

Original changelist description (http://codereview.chromium.org/17608):

Context menu for title bar doesn't appear when a tab's context menu was open.

---------------------------------------------------------------------------
* About the Bug
---------------------------------------------------------------------------

- What steps will reproduce the problem?

1. Open the context menu for a tab of your choice.
2. Right-click on the title bar.

- What is the expected result?

The application context menu should show up.

- What happens instead?

Nothing (The tab's context menu is correctly closed, of course).

- What is the reason?

The context menu for an App is displayed when WM_NCRBUTTONDOWN event is
processed on the Window::OnNCRButtonDown() handler.

In normal case, when the right mouse button is clicked on the NC area, this
event is generated. But in the case that the context menu for a tab is being
displayed,  WM_NCRBUTTONDOWN is not received. Instead, WM_NCLBUTTONDOWN is
generated. (This is wrong because left mouse button is never pressed.)

So the right handler (Window::OnNCRButtonDown()) cannot be called.

---------------------------------------------------------------------------
* About the Fix
---------------------------------------------------------------------------

What is modified?

Modified MenuController::RepostEvent() method. This function is called when the
mouse button is pressed while the context menu for a tab is being displayed.

In this function, following two steps occur in order.

1st. Determine the event type.
2nd. Post this event using PostMessage().

On the 2nd step,

In the case that the determined event on the 1st step is for the client area,
there's no problem. But in the case of the non-client area, it doesn't use the
right event type but use the fixed event type (WM_NCLBUTTONDOWN). This is the
wrong implementation.

So, I modified this part so that it use the right event type.

Bug=5695

http://crbug.com/5695
Review URL: http://codereview.chromium.org/21354

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9761 0039d316-1c4b-4281-b951-d872f2087c98
chrome/views/chrome_menu.cc