summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_window_controller.mm
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-06 00:30:11 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-06 00:30:11 +0000
commitb96f37d0d4d2425175194bd6fb5dc4458d47971b (patch)
tree37d43b2cb90881a369811dae4ac4ea6a4acc30f6 /chrome/browser/cocoa/browser_window_controller.mm
parent4c6092c5b185ac77c5751947f3ec335bc3db68f2 (diff)
downloadchromium_src-b96f37d0d4d2425175194bd6fb5dc4458d47971b.zip
chromium_src-b96f37d0d4d2425175194bd6fb5dc4458d47971b.tar.gz
chromium_src-b96f37d0d4d2425175194bd6fb5dc4458d47971b.tar.bz2
Only allow tabs to be dragged between compatible windows.
Right now, this means windows with the same Profile. http://crbug.com/12241 TEST=Open some tabs in incognito and regular windows. Try to drag between. Should be able to drag between like security contexts (incognito to incognito, regular to regular), but not across. Review URL: http://codereview.chromium.org/119266 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17807 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/browser_window_controller.mm15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_window_controller.mm b/chrome/browser/cocoa/browser_window_controller.mm
index 2cb822b..a138905 100644
--- a/chrome/browser/cocoa/browser_window_controller.mm
+++ b/chrome/browser/cocoa/browser_window_controller.mm
@@ -364,6 +364,21 @@ willPositionSheet:(NSWindow *)sheet
return [tabStripController_ selectedTabGrowBoxRect];
}
+// Accept tabs from a BrowserWindowController with the same Profile.
+- (BOOL)canReceiveFrom:(TabWindowController*)source {
+ if (![source isKindOfClass:[BrowserWindowController class]]) {
+ return NO;
+ }
+
+ BrowserWindowController* realSource =
+ static_cast<BrowserWindowController*>(source);
+ if (browser_->profile() != realSource->browser_->profile()) {
+ return NO;
+ }
+
+ return YES;
+}
+
// Move a given tab view to the location of the current placeholder. If there is
// no placeholder, it will go at the end. |controller| is the window controller
// of a tab being dropped from a different window. It will be nil if the drag is