Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
=================================================================== |
--- chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm (revision 86295) |
+++ chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm (working copy) |
@@ -47,7 +47,6 @@ |
#include "chrome/browser/ui/find_bar/find_tab_helper.h" |
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
#include "chrome/browser/ui/tabs/tab_menu_model.h" |
-#include "chrome/browser/ui/title_prefix_matcher.h" |
#include "chrome/common/chrome_switches.h" |
#include "chrome/common/pref_names.h" |
#include "content/browser/tab_contents/navigation_controller.h" |
@@ -172,7 +171,6 @@ |
givesIndex:(NSInteger*)index |
disposition:(WindowOpenDisposition*)disposition; |
- (void)setNewTabButtonHoverState:(BOOL)showHover; |
-- (void)updateCommonTitlePrefix; |
- (BOOL)shouldShowProfileMenuButton; |
- (void)updateProfileMenuButton; |
@end |
@@ -1194,8 +1192,6 @@ |
// else. |
[self updateFaviconForContents:contents atIndex:modelIndex]; |
- [self updateCommonTitlePrefix]; |
- |
// Send a broadcast that the number of tabs have changed. |
[[NSNotificationCenter defaultCenter] |
postNotificationName:kTabStripNumberOfTabsChanged |
@@ -1327,8 +1323,6 @@ |
// Once we're totally done with the tab, delete its controller |
[tabArray_ removeObjectAtIndex:index]; |
- |
- [self updateCommonTitlePrefix]; |
} |
// Called by the CAAnimation delegate when the tab completes the closing |
@@ -1530,8 +1524,6 @@ |
TabContentsController* updatedController = |
[tabContentsArray_ objectAtIndex:index]; |
[updatedController tabDidChange:contents->tab_contents()]; |
- |
- [self updateCommonTitlePrefix]; |
} |
// Called when a tab is moved (usually by drag&drop). Keep our parallel arrays |
@@ -1587,8 +1579,6 @@ |
// the tab has already been rendered, so re-layout the tabstrip. In all other |
// cases, the state is set before the tab is rendered so this isn't needed. |
[self layoutTabs]; |
- |
- [self updateCommonTitlePrefix]; |
} |
- (void)setFrameOfActiveTab:(NSRect)frame { |
@@ -2122,40 +2112,6 @@ |
} |
} |
-// Update the lengths of common title prefixes for all tabs. This needs |
-// to be done every time tabs are added/removed or when titles change. |
-- (void)updateCommonTitlePrefix { |
- DCHECK_EQ([tabArray_ count], [tabArray_ count]); |
- |
- std::vector<TitlePrefixMatcher::TitleInfo> tabTitleInfos; |
- ScopedVector<string16> titles; |
- size_t tabIndex; |
- size_t tabCount = [tabArray_ count]; |
- |
- // Add all tab titles to |tabTitleInfos|. |
- for (tabIndex = 0; tabIndex < tabCount; ++tabIndex) { |
- TabController* tabController = [tabArray_ objectAtIndex:tabIndex]; |
- string16 title = base::SysNSStringToUTF16([tabController title]); |
- if (!title.empty() && ![tabController mini]) { |
- titles.push_back(new string16(title)); |
- tabTitleInfos.push_back(TitlePrefixMatcher::TitleInfo( |
- titles[titles.size() - 1], [tabController url], tabIndex)); |
- } |
- } |
- |
- // Calculate the prefix length. |
- TitlePrefixMatcher::CalculatePrefixLengths(&tabTitleInfos); |
- |
- // Update the prefix length for each tab. |
- for (size_t infoIndex = 0; infoIndex < tabTitleInfos.size(); ++infoIndex) { |
- tabIndex = tabTitleInfos[infoIndex].caller_value; |
- DCHECK(tabIndex < [tabArray_ count]); |
- TabController* tabController = [tabArray_ objectAtIndex:tabIndex]; |
- [tabController setTitleCommonPrefixLength: |
- tabTitleInfos[infoIndex].prefix_length]; |
- } |
-} |
- |
- (BOOL)shouldShowProfileMenuButton { |
if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles)) |
return NO; |