summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 21:33:40 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-02 21:33:40 +0000
commitf431704be7dfe258834c19c1c18d837fb46a3d16 (patch)
treed9d106fe2525ced0af163d45771ed9ed666b29ee /chrome/browser/views
parent6b847b31ab8c19ba2637359d1a6b4ecf9d8983a3 (diff)
downloadchromium_src-f431704be7dfe258834c19c1c18d837fb46a3d16.zip
chromium_src-f431704be7dfe258834c19c1c18d837fb46a3d16.tar.gz
chromium_src-f431704be7dfe258834c19c1c18d837fb46a3d16.tar.bz2
When dropping a tab torn from a maximized window, inherit the restored size and maximized state, instead of creating a restored window at the maximized size.
BUG=22154 TEST=Drag a tab from a maximized window and drop it; it should create a maximized window. Review URL: http://codereview.chromium.org/3032039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54607 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r--chrome/browser/views/tabs/dragged_tab_controller.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc
index 68863c1..4de14ad 100644
--- a/chrome/browser/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/views/tabs/dragged_tab_controller.cc
@@ -1210,10 +1210,9 @@ void DraggedTabController::CompleteDrag() {
}
}
// Compel the model to construct a new window for the detached TabContents.
- gfx::Rect browser_rect = source_tabstrip_->GetWindow()->GetBounds();
- gfx::Rect window_bounds(
- GetWindowCreatePoint(),
- gfx::Size(browser_rect.width(), browser_rect.height()));
+ views::Window* window = source_tabstrip_->GetWindow();
+ gfx::Rect window_bounds(window->GetNormalBounds());
+ window_bounds.set_origin(GetWindowCreatePoint());
// When modifying the following if statement, please make sure not to
// introduce issue listed in http://crbug.com/6223 comment #11.
bool rtl_ui = base::i18n::IsRTL();
@@ -1225,7 +1224,7 @@ void DraggedTabController::CompleteDrag() {
}
Browser* new_browser =
GetModel(source_tabstrip_)->delegate()->CreateNewStripWithContents(
- dragged_contents_, window_bounds, dock_info_);
+ dragged_contents_, window_bounds, dock_info_, window->IsMaximized());
TabStripModel* new_model = new_browser->tabstrip_model();
new_model->SetTabPinned(new_model->GetIndexOfTabContents(dragged_contents_),
pinned_);