diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-05 01:45:00 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-05 01:45:00 +0000 |
commit | 85b2310f77ff3dd435f69a2af1a16850ad204489 (patch) | |
tree | 2bbeb905e39bf47fe8504f73514914ebe72fe911 /chrome/browser/tabs | |
parent | b95efdd62ec71230dab3ba599cecc62c7e2e92a2 (diff) | |
download | chromium_src-85b2310f77ff3dd435f69a2af1a16850ad204489.zip chromium_src-85b2310f77ff3dd435f69a2af1a16850ad204489.tar.gz chromium_src-85b2310f77ff3dd435f69a2af1a16850ad204489.tar.bz2 |
Add the TabStrip to the BrowserView2. (hooked up for OpaqueFrame only at this point). Make non-client hittest logic mostly work. Window is somewhat interactive again. Yay!
B=1031854
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r-- | chrome/browser/tabs/tab_strip.cc | 19 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip.h | 6 |
2 files changed, 25 insertions, 0 deletions
diff --git a/chrome/browser/tabs/tab_strip.cc b/chrome/browser/tabs/tab_strip.cc index e6539a9..0c85bec 100644 --- a/chrome/browser/tabs/tab_strip.cc +++ b/chrome/browser/tabs/tab_strip.cc @@ -494,6 +494,25 @@ bool TabStrip::CanProcessInputEvents() const { return IsAnimating() == NULL; } +bool TabStrip::PointIsWithinWindowCaption(const CPoint& point) { + ChromeViews::View* v = GetViewForPoint(point); + + // If there is no control at this location, claim the hit was in the title + // bar to get a move action. + 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; + + // All other regions, including the new Tab button, should be considered part + // of the containing Window's client area so that regular events can be + // processed for them. + return false; +} + bool TabStrip::IsCompatibleWith(TabStrip* other) { return model_->profile() == other->model()->profile(); } diff --git a/chrome/browser/tabs/tab_strip.h b/chrome/browser/tabs/tab_strip.h index 64195a3..ec1e555 100644 --- a/chrome/browser/tabs/tab_strip.h +++ b/chrome/browser/tabs/tab_strip.h @@ -90,6 +90,12 @@ class TabStrip : public ChromeViews::View, // not be allowed to interact with the TabStrip. bool CanProcessInputEvents() const; + // Returns true if the specified point (in TabStrip coordinates) is within a + // portion of the TabStrip that should be treated as the containing Window's + // titlebar for dragging purposes. + // TODO(beng): (Cleanup) should be const, but GetViewForPoint isn't, so fie! + bool PointIsWithinWindowCaption(const CPoint& point); + // Return true if this tab strip is compatible with the provided tab strip. // Compatible tab strips can transfer tabs during drag and drop. bool IsCompatibleWith(TabStrip* other); |