Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 120163005: Make tab tooltip behavior consistent across all desktop platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <limits> 10 #include <limits>
(...skipping 1205 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 [self layoutTabsWithAnimation:initialLayoutComplete_ regenerateSubviews:YES]; 1216 [self layoutTabsWithAnimation:initialLayoutComplete_ regenerateSubviews:YES];
1217 } 1217 }
1218 1218
1219 - (void)layoutTabsWithoutAnimation { 1219 - (void)layoutTabsWithoutAnimation {
1220 [self layoutTabsWithAnimation:NO regenerateSubviews:YES]; 1220 [self layoutTabsWithAnimation:NO regenerateSubviews:YES];
1221 } 1221 }
1222 1222
1223 // Handles setting the title of the tab based on the given |contents|. Uses 1223 // Handles setting the title of the tab based on the given |contents|. Uses
1224 // a canned string if |contents| is NULL. 1224 // a canned string if |contents| is NULL.
1225 - (void)setTabTitle:(TabController*)tab withContents:(WebContents*)contents { 1225 - (void)setTabTitle:(TabController*)tab withContents:(WebContents*)contents {
1226 // TODO(miu): Rectify inconsistent tooltip behavior. http://crbug.com/310947
1227
1228 base::string16 title; 1226 base::string16 title;
1229 if (contents) 1227 if (contents)
1230 title = contents->GetTitle(); 1228 title = contents->GetTitle();
1231 if (title.empty()) 1229 if (title.empty())
1232 title = l10n_util::GetStringUTF16(IDS_BROWSER_WINDOW_MAC_TAB_UNTITLED); 1230 title = l10n_util::GetStringUTF16(IDS_BROWSER_WINDOW_MAC_TAB_UNTITLED);
1233 [tab setTitle:base::SysUTF16ToNSString(title)]; 1231 [tab setTitle:base::SysUTF16ToNSString(title)];
1234 1232
1235 const base::string16& toolTip = chrome::AssembleTabTooltipText( 1233 const base::string16& toolTip = chrome::AssembleTabTooltipText(
1236 title, chrome::GetTabMediaStateForContents(contents)); 1234 title, chrome::GetTabMediaStateForContents(contents));
1237 [tab setToolTip:base::SysUTF16ToNSString(toolTip)]; 1235 [tab setToolTip:base::SysUTF16ToNSString(toolTip)];
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2217 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) { 2215 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) {
2218 // View hierarchy of the contents view: 2216 // View hierarchy of the contents view:
2219 // NSView -- switchView, same for all tabs 2217 // NSView -- switchView, same for all tabs
2220 // +- NSView -- TabContentsController's view 2218 // +- NSView -- TabContentsController's view
2221 // +- TabContentsViewCocoa 2219 // +- TabContentsViewCocoa
2222 // 2220 //
2223 // Changing it? Do not forget to modify 2221 // Changing it? Do not forget to modify
2224 // -[TabStripController swapInTabAtIndex:] too. 2222 // -[TabStripController swapInTabAtIndex:] too.
2225 return [web_contents->GetView()->GetNativeView() superview]; 2223 return [web_contents->GetView()->GetNativeView() superview];
2226 } 2224 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698