From 23eb8cd1862166d32bff8dcf9ee1b6e0e4717fff Mon Sep 17 00:00:00 2001
From: "ben@chromium.org"
 <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Date: Mon, 9 Mar 2009 22:29:01 +0000
Subject: Make the last tab part of the client area instead of the non-client
 as it is now.

Remove some stupid code in the Tab's mouse pressed handler that was duplicating the nc-hittest handler. o_O.

http://crbug.com/8519

Review URL: http://codereview.chromium.org/41018

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11299 0039d316-1c4b-4281-b951-d872f2087c98
---
 chrome/browser/views/tabs/tab.cc       | 9 ---------
 chrome/browser/views/tabs/tab_strip.cc | 5 -----
 2 files changed, 14 deletions(-)

diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc
index fdd6b65..d0143d9 100644
--- a/chrome/browser/views/tabs/tab.cc
+++ b/chrome/browser/views/tabs/tab.cc
@@ -159,15 +159,6 @@ void Tab::GetHitTestMask(gfx::Path* mask) const {
 
 bool Tab::OnMousePressed(const views::MouseEvent& event) {
   if (event.IsLeftMouseButton()) {
-    // When only one tab is present, instead of ripping it out on drag,
-    // it dragged the whole window. This is done by sending a non-client
-    // message which is handled by the default window procedure and causes
-    // the window get the default drag-on-caption behavior.
-    if (!delegate_->HasAvailableDragActions()) {
-      SendMessage(GetWidget()->GetHWND(), WM_NCLBUTTONDOWN,
-                  HTCAPTION, MAKELPARAM(event.x(), event.y()));
-      return false;
-    }
     // Store whether or not we were selected just now... we only want to be
     // able to drag foreground tabs, so we don't start dragging the tab if
     // it was in the background.
diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc
index cfb9a50..c256a82 100644
--- a/chrome/browser/views/tabs/tab_strip.cc
+++ b/chrome/browser/views/tabs/tab_strip.cc
@@ -503,11 +503,6 @@ bool TabStrip::PointIsWithinWindowCaption(const gfx::Point& point) {
   if (v == this)
     return true;
 
-  // If the point is within the bounds of a Tab, the point can be considered
-  // part of the caption if there are no available drag operations for the Tab.
-  if (v->GetClassName() == Tab::kTabClassName && !HasAvailableDragActions())
-    return true;
-
   // Check to see if the point is within the non-button parts of the new tab
   // button. The button has a non-rectangular shape, so if it's not in the
   // visual portions of the button we treat it as a click to the caption.
-- 
cgit v1.1