summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tabs/tab_strip_gtk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk/tabs/tab_strip_gtk.cc')
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc38
1 files changed, 15 insertions, 23 deletions
diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
index 0547815..41d1e27 100644
--- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "app/animation_delegate.h"
#include "app/gtk_dnd_util.h"
#include "app/resource_bundle.h"
#include "app/slide_animation.h"
@@ -21,6 +22,8 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tabs/tab_strip_model_delegate.h"
#include "chrome/browser/themes/browser_theme_provider.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/notification_type.h"
#include "gfx/gtk_util.h"
@@ -1612,20 +1615,19 @@ bool TabStripGtk::CompleteDrop(guchar* data) {
if (!url.is_valid())
return false;
+ browser::NavigateParams params(window()->browser(), url,
+ PageTransition::LINK);
+ params.tabstrip_index = drop_index;
+
if (drop_before) {
- // Insert a new tab.
- TabContents* contents =
- model_->delegate()->CreateTabContentsForURL(
- url, GURL(), model_->profile(), PageTransition::TYPED, false,
- NULL);
- model_->AddTabContents(contents, drop_index, PageTransition::GENERATED,
- TabStripModel::ADD_SELECTED);
+ params.disposition = NEW_FOREGROUND_TAB;
} else {
- model_->GetTabContentsAt(drop_index)->controller().LoadURL(
- url, GURL(), PageTransition::GENERATED);
- model_->SelectTabContentsAt(drop_index, true);
+ params.disposition = CURRENT_TAB;
+ params.source_contents = model_->GetTabContentsAt(drop_index);
}
+ browser::Navigate(&params);
+
return true;
}
@@ -1974,19 +1976,9 @@ void TabStripGtk::OnNewTabClicked(GtkWidget* widget) {
if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url))
return;
- TabContents* contents =
- model_->delegate()->CreateTabContentsForURL(
- url,
- GURL(), // referrer
- model_->profile(),
- PageTransition::TYPED,
- false, // defer_load
- NULL); // instance
- model_->AddTabContents(
- contents,
- -1, // index
- PageTransition::TYPED,
- TabStripModel::ADD_SELECTED);
+ Browser* browser = window_->browser();
+ DCHECK(browser);
+ browser->AddSelectedTabWithURL(url, PageTransition::TYPED);
break;
}
default: