| Index: chrome/browser/gtk/tabs/tab_strip_gtk.cc
|
| ===================================================================
|
| --- chrome/browser/gtk/tabs/tab_strip_gtk.cc (revision 66453)
|
| +++ chrome/browser/gtk/tabs/tab_strip_gtk.cc (working copy)
|
| @@ -19,6 +19,7 @@
|
| #include "chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h"
|
| #include "chrome/browser/profile.h"
|
| #include "chrome/browser/tab_contents/tab_contents.h"
|
| +#include "chrome/browser/tab_contents_wrapper.h"
|
| #include "chrome/browser/tabs/tab_strip_model_delegate.h"
|
| #include "chrome/browser/themes/browser_theme_provider.h"
|
| #include "chrome/browser/ui/browser.h"
|
| @@ -812,10 +813,10 @@
|
| --index;
|
| } else {
|
| TabRendererGtk::AnimationState state;
|
| - TabContents* contents = model_->GetTabContentsAt(index);
|
| - if (!contents || !contents->is_loading()) {
|
| + TabContentsWrapper* contents = model_->GetTabContentsAt(index);
|
| + if (!contents || !contents->tab_contents()->is_loading()) {
|
| state = TabGtk::ANIMATION_NONE;
|
| - } else if (contents->waiting_for_response()) {
|
| + } else if (contents->tab_contents()->waiting_for_response()) {
|
| state = TabGtk::ANIMATION_WAITING;
|
| } else {
|
| state = TabGtk::ANIMATION_LOADING;
|
| @@ -924,7 +925,7 @@
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // TabStripGtk, TabStripModelObserver implementation:
|
|
|
| -void TabStripGtk::TabInsertedAt(TabContents* contents,
|
| +void TabStripGtk::TabInsertedAt(TabContentsWrapper* contents,
|
| int index,
|
| bool foreground) {
|
| DCHECK(contents);
|
| @@ -939,7 +940,8 @@
|
| // has the Tab already constructed and we can just insert it into our list
|
| // again.
|
| if (IsDragSessionActive()) {
|
| - tab = drag_controller_->GetDragSourceTabForContents(contents);
|
| + tab = drag_controller_->GetDragSourceTabForContents(
|
| + contents->tab_contents());
|
| if (tab) {
|
| // If the Tab was detached, it would have been animated closed but not
|
| // removed, so we need to reset this property.
|
| @@ -963,7 +965,7 @@
|
| if (!contains_tab) {
|
| TabData d = { tab, gfx::Rect() };
|
| tab_data_.insert(tab_data_.begin() + index, d);
|
| - tab->UpdateData(contents, model_->IsAppTab(index), false);
|
| + tab->UpdateData(contents->tab_contents(), model_->IsAppTab(index), false);
|
| }
|
| tab->set_mini(model_->IsMiniTab(index));
|
| tab->set_app(model_->IsAppTab(index));
|
| @@ -984,17 +986,17 @@
|
| }
|
| }
|
|
|
| -void TabStripGtk::TabDetachedAt(TabContents* contents, int index) {
|
| +void TabStripGtk::TabDetachedAt(TabContentsWrapper* contents, int index) {
|
| GenerateIdealBounds();
|
| - StartRemoveTabAnimation(index, contents);
|
| + StartRemoveTabAnimation(index, contents->tab_contents());
|
| // Have to do this _after_ calling StartRemoveTabAnimation, so that any
|
| // previous remove is completed fully and index is valid in sync with the
|
| // model index.
|
| GetTabAt(index)->set_closing(true);
|
| }
|
|
|
| -void TabStripGtk::TabSelectedAt(TabContents* old_contents,
|
| - TabContents* new_contents,
|
| +void TabStripGtk::TabSelectedAt(TabContentsWrapper* old_contents,
|
| + TabContentsWrapper* new_contents,
|
| int index,
|
| bool user_gesture) {
|
| DCHECK(index >= 0 && index < static_cast<int>(GetTabCount()));
|
| @@ -1014,7 +1016,7 @@
|
| }
|
| }
|
|
|
| -void TabStripGtk::TabMoved(TabContents* contents,
|
| +void TabStripGtk::TabMoved(TabContentsWrapper* contents,
|
| int from_index,
|
| int to_index) {
|
| gfx::Rect start_bounds = GetIdealBounds(from_index);
|
| @@ -1028,7 +1030,7 @@
|
| StartMoveTabAnimation(from_index, to_index);
|
| }
|
|
|
| -void TabStripGtk::TabChangedAt(TabContents* contents, int index,
|
| +void TabStripGtk::TabChangedAt(TabContentsWrapper* contents, int index,
|
| TabChangeType change_type) {
|
| // Index is in terms of the model. Need to make sure we adjust that index in
|
| // case we have an animation going.
|
| @@ -1039,19 +1041,19 @@
|
| // We'll receive another notification of the change asynchronously.
|
| return;
|
| }
|
| - tab->UpdateData(contents,
|
| + tab->UpdateData(contents->tab_contents(),
|
| model_->IsAppTab(index),
|
| change_type == LOADING_ONLY);
|
| tab->UpdateFromModel();
|
| }
|
|
|
| -void TabStripGtk::TabReplacedAt(TabContents* old_contents,
|
| - TabContents* new_contents,
|
| +void TabStripGtk::TabReplacedAt(TabContentsWrapper* old_contents,
|
| + TabContentsWrapper* new_contents,
|
| int index) {
|
| TabChangedAt(new_contents, index, ALL);
|
| }
|
|
|
| -void TabStripGtk::TabMiniStateChanged(TabContents* contents, int index) {
|
| +void TabStripGtk::TabMiniStateChanged(TabContentsWrapper* contents, int index) {
|
| // Don't do anything if we've already picked up the change from TabMoved.
|
| if (GetTabAt(index)->mini() == model_->IsMiniTab(index))
|
| return;
|
| @@ -1067,7 +1069,8 @@
|
| }
|
| }
|
|
|
| -void TabStripGtk::TabBlockedStateChanged(TabContents* contents, int index) {
|
| +void TabStripGtk::TabBlockedStateChanged(TabContentsWrapper* contents,
|
| + int index) {
|
| GetTabAt(index)->SetBlocked(model_->IsTabBlocked(index));
|
| }
|
|
|
| @@ -1975,9 +1978,25 @@
|
| if (!gtk_util::URLFromPrimarySelection(model_->profile(), &url))
|
| return;
|
|
|
| +<<<<<<< .mine
|
| + TabContentsWrapper* 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);
|
| +>>>>>>> .r66288
|
| break;
|
| }
|
| default:
|
|
|