summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authormdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-23 20:34:34 +0000
committermdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-23 20:34:34 +0000
commit57f96637eae4b93c1510c1fd5581a5c1a6d2e908 (patch)
treef961baf6f5293bed1d393a3ef0295521efa76bb9 /chrome
parent9edbd0e30cec3e3653096eaff2b838f98ee5a604 (diff)
downloadchromium_src-57f96637eae4b93c1510c1fd5581a5c1a6d2e908.zip
chromium_src-57f96637eae4b93c1510c1fd5581a5c1a6d2e908.tar.gz
chromium_src-57f96637eae4b93c1510c1fd5581a5c1a6d2e908.tar.bz2
Linux: create dropped tab windows at the restore size of the source window instead of its current size (different when the source is maximized)
BUG=22154 TEST=open a window with two tabs, maximize it, then drag one tab out - it should be the original size of the original window Review URL: http://codereview.chromium.org/216053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc2
-rw-r--r--chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc12
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc3
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.h8
4 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 07511f0..aec56c2 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -1542,7 +1542,7 @@ void BrowserWindowGtk::InitWidgets() {
G_CALLBACK(&OnCustomFrameExpose), this);
gtk_container_add(GTK_CONTAINER(window_container_), window_vbox);
- tabstrip_.reset(new TabStripGtk(browser_->tabstrip_model()));
+ tabstrip_.reset(new TabStripGtk(browser_->tabstrip_model(), this));
tabstrip_->Init();
// Build the titlebar (tabstrip + header space + min/max/close buttons).
diff --git a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
index ae12223..ed6af39 100644
--- a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
+++ b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
@@ -783,15 +783,9 @@ bool DraggedTabControllerGtk::CompleteDrag() {
destroy_immediately = false;
} else {
// Compel the model to construct a new window for the detached TabContents.
- GtkWindow* browser_window =
- platform_util::GetTopLevel(source_tabstrip_->widget());
- gint x, y, width, height;
- gtk_window_get_position(browser_window, &x, &y);
- gtk_window_get_size(browser_window, &width, &height);
- gfx::Rect browser_rect = gfx::Rect(x, y, width, height);
- gfx::Rect window_bounds(
- GetWindowCreatePoint(),
- gfx::Size(browser_rect.width(), browser_rect.height()));
+ BrowserWindowGtk* window = source_tabstrip_->window();
+ gfx::Rect window_bounds = window->GetRestoredBounds();
+ window_bounds.set_origin(GetWindowCreatePoint());
Browser* new_browser =
source_tabstrip_->model()->delegate()->CreateNewStripWithContents(
dragged_contents_, window_bounds, dock_info_);
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
index bd4cfad..60e2d20 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
@@ -672,12 +672,13 @@ class PinAndMoveAnimation : public TabStripGtk::TabAnimation {
// static
const int TabStripGtk::pinned_to_non_pinned_gap_ = 3;
-TabStripGtk::TabStripGtk(TabStripModel* model)
+TabStripGtk::TabStripGtk(TabStripModel* model, BrowserWindowGtk* window)
: current_unselected_width_(TabGtk::GetStandardSize().width()),
current_selected_width_(TabGtk::GetStandardSize().width()),
available_width_for_tabs_(-1),
resize_layout_scheduled_(false),
model_(model),
+ window_(window),
theme_provider_(GtkThemeProvider::GetFrom(model->profile())),
resize_layout_factory_(this),
added_as_message_loop_observer_(false) {
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.h b/chrome/browser/gtk/tabs/tab_strip_gtk.h
index 8805216..c72fc44 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.h
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.h
@@ -18,6 +18,7 @@
#include "chrome/common/notification_observer.h"
#include "chrome/common/owned_widget_gtk.h"
+class BrowserWindowGtk;
class CustomDrawButton;
class DraggedTabControllerGtk;
class GtkThemeProvider;
@@ -30,7 +31,7 @@ class TabStripGtk : public TabStripModelObserver,
public:
class TabAnimation;
- explicit TabStripGtk(TabStripModel* model);
+ TabStripGtk(TabStripModel* model, BrowserWindowGtk* window);
virtual ~TabStripGtk();
// Initialize and load the TabStrip into a container.
@@ -42,6 +43,8 @@ class TabStripGtk : public TabStripModelObserver,
TabStripModel* model() const { return model_; }
+ BrowserWindowGtk* window() const { return window_; }
+
GtkWidget* widget() const { return tabstrip_.get(); }
// Returns true if there is an active drag session.
@@ -426,6 +429,9 @@ class TabStripGtk : public TabStripModelObserver,
// Our model.
TabStripModel* model_;
+ // The BrowserWindowGtk containing this tab strip.
+ BrowserWindowGtk* window_;
+
// Theme resources.
GtkThemeProvider* theme_provider_;