OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |