| Index: chrome/browser/ui/views/tabs/base_tab_strip.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/tabs/base_tab_strip.cc (revision 86295)
|
| +++ chrome/browser/ui/views/tabs/base_tab_strip.cc (working copy)
|
| @@ -5,7 +5,6 @@
|
| #include "chrome/browser/ui/views/tabs/base_tab_strip.h"
|
|
|
| #include "base/logging.h"
|
| -#include "chrome/browser/ui/title_prefix_matcher.h"
|
| #include "chrome/browser/ui/view_ids.h"
|
| #include "chrome/browser/ui/views/tabs/dragged_tab_controller.h"
|
| #include "chrome/browser/ui/views/tabs/tab_strip_controller.h"
|
| @@ -132,7 +131,6 @@
|
|
|
| TabData d = { tab, gfx::Rect() };
|
| tab_data_.insert(tab_data_.begin() + ModelIndexToTabIndex(model_index), d);
|
| - UpdateCommonTitlePrefix();
|
|
|
| AddChildView(tab);
|
|
|
| @@ -160,7 +158,6 @@
|
| BaseTab* tab = GetBaseTabAtModelIndex(model_index);
|
| bool mini_state_changed = tab->data().mini != data.mini;
|
| tab->SetData(data);
|
| - UpdateCommonTitlePrefix();
|
|
|
| if (mini_state_changed) {
|
| if (GetWindow() && GetWindow()->IsVisible())
|
| @@ -473,38 +470,8 @@
|
| tab_data_.erase(tab_data_.begin() + tab_data_index);
|
|
|
| delete tab;
|
| - UpdateCommonTitlePrefix();
|
| }
|
|
|
| -bool BaseTabStrip::IgnoreTitlePrefixEliding(BaseTab* tab) {
|
| - DCHECK(tab != NULL);
|
| - return tab->data().mini || tab->data().title.empty();
|
| -}
|
| -
|
| -void BaseTabStrip::UpdateCommonTitlePrefix() {
|
| - std::vector<TitlePrefixMatcher::TitleInfo> tab_title_infos;
|
| - for (int tab_index = 0; tab_index < tab_count(); ++tab_index) {
|
| - DCHECK(tab_data_[tab_index].tab != NULL);
|
| - if (!IgnoreTitlePrefixEliding(tab_data_[tab_index].tab)) {
|
| - tab_title_infos.push_back(TitlePrefixMatcher::TitleInfo(
|
| - &tab_data_[tab_index].tab->data().title,
|
| - tab_data_[tab_index].tab->data().url,
|
| - tab_index));
|
| - }
|
| - }
|
| - TitlePrefixMatcher::CalculatePrefixLengths(&tab_title_infos);
|
| - for (size_t title_index = 0; title_index < tab_title_infos.size();
|
| - ++title_index) {
|
| - int tab_index = tab_title_infos[title_index].caller_value;
|
| - TabRendererData data = tab_data_[tab_index].tab->data();
|
| - if (data.common_prefix_length !=
|
| - tab_title_infos[title_index].prefix_length) {
|
| - data.common_prefix_length = tab_title_infos[title_index].prefix_length;
|
| - tab_data_[tab_index].tab->SetData(data);
|
| - }
|
| - }
|
| -}
|
| -
|
| int BaseTabStrip::TabIndexOfTab(BaseTab* tab) const {
|
| for (int i = 0; i < tab_count(); ++i) {
|
| if (base_tab_at_tab_index(i) == tab)
|
|
|