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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 10870094: Constrained window sheet controller (test patch) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rename Created 8 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/ui/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index c650777b21fcce8d1dc245f41ec27180e2aa593d..b68115bf507da881b8689c6ca39842d6183a3de5 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -63,6 +63,7 @@
#import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h"
#import "chrome/browser/ui/cocoa/tabs/tab_view.h"
#import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h"
+#include "chrome/browser/ui/constrained_window_tab_helper.h"
#include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
#include "chrome/browser/ui/omnibox/location_bar.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
@@ -528,18 +529,6 @@ enum {
afterDelay:0];
}
-- (void)attachConstrainedWindow:(ConstrainedWindowMac*)window {
- [tabStripController_ attachConstrainedWindow:window];
-}
-
-- (void)removeConstrainedWindow:(ConstrainedWindowMac*)window {
- [tabStripController_ removeConstrainedWindow:window];
-}
-
-- (BOOL)canAttachConstrainedWindow {
- return ![previewableContentsController_ isShowingPreview];
-}
-
- (void)updateDevToolsForContents:(WebContents*)contents {
[devToolsController_ updateDevToolsForWebContents:contents
withProfile:browser_->profile()];
@@ -1532,6 +1521,17 @@ enum {
return [self supportsWindowFeature:Browser::FEATURE_TABSTRIP];
}
+- (BOOL)isTabDraggable:(NSView*)tabView {
+ // 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.
+ int index = [tabStripController_ modelIndexForTabView:tabView];
+ TabContents* contents = chrome::GetTabContentsAt(browser_.get(), index);
+ if (!contents)
+ return NO;
+ return !contents->constrained_window_tab_helper()->constrained_window_count();
+}
+
// TabStripControllerDelegate protocol.
- (void)onActivateTabWithContents:(WebContents*)contents {
// Update various elements that are interested in knowing the current
@@ -1940,6 +1940,10 @@ willAnimateFromState:(bookmarks::VisualState)oldState
instant->CommitCurrentPreview(INSTANT_COMMIT_FOCUS_LOST);
}
+- (BOOL)isShowingInstant {
+ return previewableContentsController_ &&
+ [previewableContentsController_ isShowingPreview];
+}
- (NSRect)instantFrame {
// The view's bounds are in its own coordinate system. Convert that to the

Powered by Google App Engine
This is Rietveld 408576698