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..760e0cb4a2e2d2d96e1676b007dba6081d69f07a 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,29 @@ void BrowserWindowCocoa::UpdateTitleBar() { |
| NSString* newTitle = |
| base::SysUTF16ToNSString(browser_->GetWindowTitleForCurrentTab()); |
| + NSMutableString* titleWithMediaState = [NSMutableString string]; |
|
Robert Sesek
2015/10/22 00:01:52
Use [NSMutableString stringWithString:] to avoid u
|
| + [titleWithMediaState appendString:newTitle]; |
| + |
| + if (media_state_ == TAB_MEDIA_STATE_AUDIO_PLAYING) { |
| + [titleWithMediaState appendFormat:@"%c", kWhiteSpaceCharacter]; |
|
miu
2015/10/21 20:06:52
Can the whitespace char be included in the string
|
| + [titleWithMediaState appendString:@"🔊"]; |
|
miu
2015/10/21 20:06:52
Was this moved to generated_resources.prd? If so,
Robert Sesek
2015/10/22 00:01:52
Two appends shouldn't be necessary. Just [title a
|
| + } |
| + else if (media_state_ == TAB_MEDIA_STATE_AUDIO_MUTING) { |
|
Robert Sesek
2015/10/22 00:01:52
nit: this goes on line 310.
|
| + [titleWithMediaState appendFormat:@"%c", kWhiteSpaceCharacter]; |
| + [titleWithMediaState appendString:@"🔇"]; |
| + } |
| + |
| 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] |