Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: chrome/browser/cocoa/tab_strip_controller.mm

Issue 195043: Start a drag if the tab is dragged off the sides of the window.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/tab_strip_controller.h ('k') | chrome/browser/cocoa/tab_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_strip_controller.mm
===================================================================
--- chrome/browser/cocoa/tab_strip_controller.mm (revision 25753)
+++ chrome/browser/cocoa/tab_strip_controller.mm (working copy)
@@ -37,6 +37,10 @@
// view.
static const float kUseFullAvailableWidth = -1.0;
+// Left-side indent for tab layout so tabs don't overlap with the window
+// controls.
+static const float kIndentLeavingSpaceForControls = 64.0;
+
// A simple view class that prevents the Window Server from dragging the area
// behind tabs. Sometimes core animation confuses it. Unfortunately, it can also
// falsely pick up clicks during rapid tab closure, so we have to account for
@@ -321,6 +325,12 @@
[self layoutTabs];
}
+- (BOOL)isTabFullyVisible:(TabView*)tab {
+ NSRect frame = [tab frame];
+ return NSMinX(frame) >= kIndentLeavingSpaceForControls &&
+ NSMaxX(frame) <= NSMaxX([tabView_ frame]);
+}
+
- (void)showNewTabButton:(BOOL)show {
forceNewTabButtonHidden_ = show ? NO : YES;
if (forceNewTabButtonHidden_)
@@ -338,7 +348,6 @@
// tabs would cause an overflow.
- (void)layoutTabsWithAnimation:(BOOL)animate
regenerateSubviews:(BOOL)doUpdate {
- const float kIndentLeavingSpaceForControls = 64.0;
const float kTabOverlap = 20.0;
const float kNewTabButtonOffset = 8.0;
const float kMaxTabWidth = [TabController maxTabWidth];
« no previous file with comments | « chrome/browser/cocoa/tab_strip_controller.h ('k') | chrome/browser/cocoa/tab_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698