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

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

Issue 10871082: Constrained Windows Cocoa: Part 4 Refactor ConstrainedWindowSupport (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 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
Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
index 9a0a1c9a836f3449b0db2f641fbbdf3ded867feb..4777fdbc0c53e0732a560cd25ccebe094d910f79 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -2076,55 +2076,4 @@ private:
tabStripModel_->ActivateTabAt(index, false /* not a user gesture */);
}
-- (void)attachConstrainedWindow:(ConstrainedWindowMac*)window {
- // TODO(thakis, avi): Figure out how to make this work when tabs are dragged
- // out or if fullscreen mode is toggled.
-
- // View hierarchy of the contents view:
- // NSView -- switchView, same for all tabs
- // +- NSView -- TabContentsController's view
- // +- TabContentsViewCocoa
- // Changing it? Do not forget to modify removeConstrainedWindow too.
- // We use the TabContentsController's view in |swapInTabAtIndex|, so we have
Nico 2012/09/04 15:56:03 This comment is still true, right? Move it to the
sail 2012/09/04 17:04:22 Done. I view hierarchy related code into a helper
- // to pass it to the sheet controller here.
- NSView* tabContentsView =
- [window->owner()->web_contents()->GetNativeView() superview];
- window->delegate()->RunSheet([self sheetController], tabContentsView);
-
- // TODO(avi, thakis): GTMWindowSheetController has no api to move tabsheets
- // between windows. Until then, we have to prevent having to move a tabsheet
- // between windows, e.g. no tearing off of tabs.
- NSInteger modelIndex = [self modelIndexForContentsView:tabContentsView];
- NSInteger index = [self indexFromModelIndex:modelIndex];
- BrowserWindowController* controller =
- (BrowserWindowController*)[[switchView_ window] windowController];
- DCHECK(controller != nil);
- DCHECK(index >= 0);
- if (index >= 0) {
- [controller setTab:[self viewAtIndex:index] isDraggable:NO];
- }
-}
-
-- (void)removeConstrainedWindow:(ConstrainedWindowMac*)window {
- NSView* tabContentsView =
- [window->owner()->web_contents()->GetNativeView() superview];
-
- // TODO(avi, thakis): GTMWindowSheetController has no api to move tabsheets
- // between windows. Until then, we have to prevent having to move a tabsheet
- // between windows, e.g. no tearing off of tabs.
- NSInteger modelIndex = [self modelIndexForContentsView:tabContentsView];
- if (modelIndex < 0) {
- // This can happen during shutdown where the tab contents view has already
- // removed itself.
- return;
- }
- NSInteger index = [self indexFromModelIndex:modelIndex];
- BrowserWindowController* controller =
- (BrowserWindowController*)[[switchView_ window] windowController];
- DCHECK(index >= 0);
- if (index >= 0) {
- [controller setTab:[self viewAtIndex:index] isDraggable:YES];
- }
-}
-
@end

Powered by Google App Engine
This is Rietveld 408576698