Chromium Code Reviews| Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| index 028c744d53dd56751ccc7c2e29262a534a056ffc..3b2a55f18ebbceef7ab1ff4cc58cbee980be58b2 100644 |
| --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm |
| @@ -88,6 +88,8 @@ const int kBookmarkAppBubbleViewHeight = 46; |
| const int kIconPreviewTargetSize = 128; |
| +const char kWhiteSpaceCharacter = ' '; |
| + |
| base::string16 TrimText(NSString* controlText) { |
| base::string16 text = base::SysNSStringToUTF16(controlText); |
| base::TrimWhitespace(text, base::TRIM_ALL, &text); |
| @@ -299,12 +301,25 @@ void BrowserWindowCocoa::UpdateTitleBar() { |
| NSString* newTitle = |
| base::SysUTF16ToNSString(browser_->GetWindowTitleForCurrentTab()); |
| + NSMutableString* titleWithMediaState = [NSMutableString |
| + stringWithString:newTitle]; |
|
Robert Sesek
2015/10/23 14:26:37
There's no reason to not keep |newTitle| around at
|
| + |
| + if (media_state_ == TAB_MEDIA_STATE_AUDIO_PLAYING) |
| + [titleWithMediaState appendFormat:@"%c 🔊", kWhiteSpaceCharacter]; |
|
Robert Sesek
2015/10/23 14:26:37
There's now the %c whitespace character that's bei
|
| + else if (media_state_ == TAB_MEDIA_STATE_AUDIO_MUTING) |
|
Robert Sesek
2015/10/23 14:26:37
nit: extra space after ==
|
| + [titleWithMediaState appendFormat:@"%c 🔇", kWhiteSpaceCharacter]; |
| + |
| pending_window_title_.reset( |
| [BrowserWindowUtils scheduleReplaceOldTitle:pending_window_title_.get() |
| - withNewTitle:newTitle |
| + withNewTitle:titleWithMediaState |
| forWindow:window()]); |
| } |
| +void BrowserWindowCocoa::UpdateMediaState(TabMediaState media_state) { |
| + media_state_ = media_state; |
| + UpdateTitleBar(); |
| +} |
| + |
| void BrowserWindowCocoa::BookmarkBarStateChanged( |
| BookmarkBar::AnimateChangeType change_type) { |
| [[controller_ bookmarkBarController] |