summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tabs
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-28 16:09:39 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-28 16:09:39 +0000
commit4a1665446b3c96006be66b7083511a2eadef6b5e (patch)
treec26f796a595058bb57f0818e003dece2494c1714 /chrome/browser/gtk/tabs
parentaeacd285cabfb269ba52fdbb1f60a6bf1e2d94d6 (diff)
downloadchromium_src-4a1665446b3c96006be66b7083511a2eadef6b5e.zip
chromium_src-4a1665446b3c96006be66b7083511a2eadef6b5e.tar.gz
chromium_src-4a1665446b3c96006be66b7083511a2eadef6b5e.tar.bz2
Attempt 2 at Moving Browser::AddTypes to TabStripModel. The first
attempt caused some flakiness on the new tab warm startup test. The only difference between this and the last is that I'm leaving some suspcious code in TabStripModel::InsertTabContents and Browser::AddTabWithURL. I'll try to isolate why those changes caused flakiness after I land the rest. Here's the description: Moves Browser::AddTypes to TabStripModel. This patch is primarily cleanup before I fix 29933, but has a couple of interesting bits beyond the enum change: . AddTabContents now supports adding pinned. . Converted InsertTabContents call in extensionstabmodule to pass in nothing (Rafael said old code was wrong). BUG=29933 TEST=none TBR=ben@chromium.org Review URL: http://codereview.chromium.org/2866024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50981 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tabs')
-rw-r--r--chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc18
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc7
2 files changed, 15 insertions, 10 deletions
diff --git a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
index 5ba1d37..70ecdb8 100644
--- a/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
+++ b/chrome/browser/gtk/tabs/dragged_tab_controller_gtk.cc
@@ -394,8 +394,10 @@ void DraggedTabControllerGtk::Attach(TabStripGtk* attached_tabstrip,
// changing due to animation).
gfx::Rect bounds = GetDraggedTabTabStripBounds(screen_point);
int index = GetInsertionIndexForDraggedBounds(bounds, false);
- attached_tabstrip_->model()->InsertTabContentsAt(index, dragged_contents_,
- true, false, pinned_);
+ attached_tabstrip_->model()->InsertTabContentsAt(
+ index, dragged_contents_,
+ TabStripModel::ADD_SELECTED |
+ (pinned_ ? TabStripModel::ADD_PINNED : 0));
tab = GetTabMatchingDraggedContents(attached_tabstrip_);
}
@@ -616,8 +618,10 @@ void DraggedTabControllerGtk::RevertDrag() {
// TODO(beng): (Cleanup) seems like we should use Attach() for this
// somehow.
attached_tabstrip_ = source_tabstrip_;
- source_tabstrip_->model()->InsertTabContentsAt(source_model_index_,
- dragged_contents_, true, false, pinned_);
+ source_tabstrip_->model()->InsertTabContentsAt(
+ source_model_index_, dragged_contents_,
+ TabStripModel::ADD_SELECTED |
+ (pinned_ ? TabStripModel::ADD_PINNED : 0));
} else {
// The tab was moved within the tabstrip where the drag was initiated.
// Move it back to the starting location.
@@ -631,8 +635,10 @@ void DraggedTabControllerGtk::RevertDrag() {
// The tab was detached from the tabstrip where the drag began, and has not
// been attached to any other tabstrip. We need to put it back into the
// source tabstrip.
- source_tabstrip_->model()->InsertTabContentsAt(source_model_index_,
- dragged_contents_, true, false, pinned_);
+ source_tabstrip_->model()->InsertTabContentsAt(
+ source_model_index_, dragged_contents_,
+ TabStripModel::ADD_SELECTED |
+ (pinned_ ? TabStripModel::ADD_PINNED : 0));
}
// If we're not attached to any tab strip, or attached to some other tab
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
index a05105a..0a86cb8 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
@@ -1611,8 +1611,8 @@ bool TabStripGtk::CompleteDrop(guchar* data) {
model_->delegate()->CreateTabContentsForURL(
url, GURL(), model_->profile(), PageTransition::TYPED, false,
NULL);
- model_->AddTabContents(contents, drop_index, false,
- PageTransition::GENERATED, true);
+ model_->AddTabContents(contents, drop_index, PageTransition::GENERATED,
+ TabStripModel::ADD_SELECTED);
} else {
model_->GetTabContentsAt(drop_index)->controller().LoadURL(
url, GURL(), PageTransition::GENERATED);
@@ -1982,9 +1982,8 @@ void TabStripGtk::OnNewTabClicked(GtkWidget* widget) {
model_->AddTabContents(
contents,
-1, // index
- false, // force_index
PageTransition::TYPED,
- true); // foreground
+ TabStripModel::ADD_SELECTED);
break;
}
default: