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

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

Issue 159780: Add support for constrained windows on os x, based on Avi's GTMWindowSheetController. (Closed)
Patch Set: Merge with ToT Created 11 years, 4 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
Index: chrome/browser/cocoa/tab_window_controller.mm
diff --git a/chrome/browser/cocoa/tab_window_controller.mm b/chrome/browser/cocoa/tab_window_controller.mm
index 34417a08f1bc6ac54fa9edf193097e6ba0825067..7684f13bdaf788a0be97b3380ca9734966588e79 100644
--- a/chrome/browser/cocoa/tab_window_controller.mm
+++ b/chrome/browser/cocoa/tab_window_controller.mm
@@ -15,6 +15,13 @@
@synthesize tabStripView = tabStripView_;
@synthesize tabContentArea = tabContentArea_;
+- (id)initWithWindow:(NSWindow *)window {
+ if ((self = [super initWithWindow:window]) != nil) {
+ lockedTabs_.reset([[NSMutableSet alloc] initWithCapacity:10]);
+ }
+ return self;
+}
+
- (void)windowDidLoad {
if ([self isNormalWindow]) {
// Place the tab bar above the content box and add it to the view hierarchy
@@ -176,4 +183,15 @@
return YES;
}
+- (BOOL)isTabDraggable:(NSView*)tabView {
+ return ![lockedTabs_ containsObject:tabView];
+}
+
+- (void)setTab:(NSView*)tabView isDraggable:(BOOL)draggable {
+ if (draggable)
+ [lockedTabs_ removeObject:tabView];
+ else
+ [lockedTabs_ addObject:tabView];
+}
+
@end

Powered by Google App Engine
This is Rietveld 408576698