| Index: chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
|
| diff --git a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
|
| index 33e55d75f4cb16388bdbdbb648f1bbbac6321dfe..e38ebd183b87415b8eabe066f6a6f714f7f8a012 100644
|
| --- a/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
|
| +++ b/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc
|
| @@ -168,7 +168,7 @@ class TabStripGtk::TabAnimation : public ui::AnimationDelegate {
|
| } else {
|
| double unselected, selected;
|
| tabstrip->GetCurrentTabWidths(&unselected, &selected);
|
| - tab_width = tab->IsSelected() ? selected : unselected;
|
| + tab_width = tab->IsActive() ? selected : unselected;
|
| }
|
|
|
| if (animation) {
|
| @@ -302,7 +302,7 @@ class InsertTabAnimation : public TabStripGtk::TabAnimation {
|
| if (tabstrip_->GetTabAt(index)->mini())
|
| return TabGtk::GetMiniWidth();
|
|
|
| - if (tabstrip_->GetTabAt(index)->IsSelected()) {
|
| + if (tabstrip_->GetTabAt(index)->IsActive()) {
|
| double delta = end_selected_width_ - start_selected_width_;
|
| return start_selected_width_ + (delta * animation_.GetCurrentValue());
|
| }
|
| @@ -383,7 +383,7 @@ class RemoveTabAnimation : public TabStripGtk::TabAnimation {
|
|
|
| // All other tabs are sized according to the start/end widths specified at
|
| // the start of the animation.
|
| - if (tab->IsSelected()) {
|
| + if (tab->IsActive()) {
|
| double delta = end_selected_width_ - start_selected_width_;
|
| return start_selected_width_ + (delta * animation_.GetCurrentValue());
|
| }
|
| @@ -491,7 +491,7 @@ class ResizeLayoutAnimation : public TabStripGtk::TabAnimation {
|
| if (tab->mini())
|
| return TabGtk::GetMiniWidth();
|
|
|
| - if (tab->IsSelected()) {
|
| + if (tab->IsActive()) {
|
| return animation_.CurrentValueBetween(start_selected_width_,
|
| end_selected_width_);
|
| }
|
| @@ -509,7 +509,7 @@ class ResizeLayoutAnimation : public TabStripGtk::TabAnimation {
|
| for (int i = 0; i < tabstrip_->GetTabCount(); ++i) {
|
| TabGtk* current_tab = tabstrip_->GetTabAt(i);
|
| if (!current_tab->mini()) {
|
| - if (current_tab->IsSelected()) {
|
| + if (current_tab->IsActive()) {
|
| start_selected_width_ = current_tab->width();
|
| } else {
|
| start_unselected_width_ = current_tab->width();
|
| @@ -563,7 +563,7 @@ class MiniTabAnimation : public TabStripGtk::TabAnimation {
|
| return TabGtk::GetMiniWidth();
|
| }
|
|
|
| - if (tab->IsSelected()) {
|
| + if (tab->IsActive()) {
|
| return animation_.CurrentValueBetween(start_selected_width_,
|
| end_selected_width_);
|
| }
|
| @@ -661,7 +661,7 @@ class MiniMoveAnimation : public TabStripGtk::TabAnimation {
|
| if (tab->mini())
|
| return TabGtk::GetMiniWidth();
|
|
|
| - if (tab->IsSelected()) {
|
| + if (tab->IsActive()) {
|
| return animation_.CurrentValueBetween(start_selected_width_,
|
| end_selected_width_);
|
| }
|
| @@ -1055,7 +1055,7 @@ void TabStripGtk::TabChangedAt(TabContentsWrapper* contents, int index,
|
| // case we have an animation going.
|
| TabGtk* tab = GetTabAtAdjustForAnimation(index);
|
| if (change_type == TITLE_NOT_LOADING) {
|
| - if (tab->mini() && !tab->IsSelected())
|
| + if (tab->mini() && !tab->IsActive())
|
| tab->StartMiniTabTitleAnimation();
|
| // We'll receive another notification of the change asynchronously.
|
| return;
|
| @@ -1097,13 +1097,20 @@ void TabStripGtk::TabBlockedStateChanged(TabContentsWrapper* contents,
|
| ////////////////////////////////////////////////////////////////////////////////
|
| // TabStripGtk, TabGtk::TabDelegate implementation:
|
|
|
| -bool TabStripGtk::IsTabSelected(const TabGtk* tab) const {
|
| +bool TabStripGtk::IsTabActive(const TabGtk* tab) const {
|
| if (tab->closing())
|
| return false;
|
|
|
| return GetIndexOfTab(tab) == model_->active_index();
|
| }
|
|
|
| +bool TabStripGtk::IsTabSelected(const TabGtk* tab) const {
|
| + if (tab->closing())
|
| + return false;
|
| +
|
| + return model_->IsTabSelected(GetIndexOfTab(tab));
|
| +}
|
| +
|
| bool TabStripGtk::IsTabDetached(const TabGtk* tab) const {
|
| if (drag_controller_.get())
|
| return drag_controller_->IsTabDetached(tab);
|
| @@ -1123,12 +1130,24 @@ bool TabStripGtk::IsTabPinned(const TabGtk* tab) const {
|
| return model_->IsTabPinned(GetIndexOfTab(tab));
|
| }
|
|
|
| -void TabStripGtk::SelectTab(TabGtk* tab) {
|
| +void TabStripGtk::ActivateTab(TabGtk* tab) {
|
| int index = GetIndexOfTab(tab);
|
| if (model_->ContainsIndex(index))
|
| model_->ActivateTabAt(index, true);
|
| }
|
|
|
| +void TabStripGtk::ToggleTabSelection(TabGtk* tab) {
|
| + int index = GetIndexOfTab(tab);
|
| + if (model_->ContainsIndex(index))
|
| + model_->ToggleSelectionAt(index);
|
| +}
|
| +
|
| +void TabStripGtk::ExtendTabSelection(TabGtk* tab) {
|
| + int index = GetIndexOfTab(tab);
|
| + if (model_->ContainsIndex(index))
|
| + model_->ExtendSelectionTo(index);
|
| +}
|
| +
|
| void TabStripGtk::CloseTab(TabGtk* tab) {
|
| int tab_index = GetIndexOfTab(tab);
|
| if (model_->ContainsIndex(tab_index)) {
|
| @@ -1347,7 +1366,7 @@ void TabStripGtk::GenerateIdealBounds() {
|
| double tab_width = unselected;
|
| if (tab->mini())
|
| tab_width = TabGtk::GetMiniWidth();
|
| - else if (tab->IsSelected())
|
| + else if (tab->IsActive())
|
| tab_width = selected;
|
| double end_of_tab = tab_x + tab_width;
|
| int rounded_tab_x = Round(tab_x);
|
| @@ -1491,7 +1510,7 @@ bool TabStripGtk::ResizeLayoutTabs() {
|
| TabGtk* first_tab = GetTabAt(mini_tab_count);
|
| double unselected, selected;
|
| GetDesiredTabWidths(GetTabCount(), mini_tab_count, &unselected, &selected);
|
| - int w = Round(first_tab->IsSelected() ? selected : unselected);
|
| + int w = Round(first_tab->IsActive() ? selected : unselected);
|
|
|
| // We only want to run the animation if we're not already at the desired
|
| // size.
|
| @@ -1920,7 +1939,7 @@ gboolean TabStripGtk::OnExpose(GtkWidget* widget, GdkEventExpose* event) {
|
| // We must ask the _Tab's_ model, not ourselves, because in some situations
|
| // the model will be different to this object, e.g. when a Tab is being
|
| // removed after its TabContents has been destroyed.
|
| - if (!tab->IsSelected()) {
|
| + if (!tab->IsActive()) {
|
| gtk_container_propagate_expose(GTK_CONTAINER(tabstrip_.get()),
|
| tab->widget(), event);
|
| } else {
|
|
|