| 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 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 void BrowserWindowCocoa::UpdateTitleBar() { | 301 void BrowserWindowCocoa::UpdateTitleBar() { |
| 302 NSString* newTitle = WindowTitle(); | 302 NSString* newTitle = WindowTitle(); |
| 303 | 303 |
| 304 pending_window_title_.reset([BrowserWindowUtils | 304 pending_window_title_.reset([BrowserWindowUtils |
| 305 scheduleReplaceOldTitle:pending_window_title_.get() | 305 scheduleReplaceOldTitle:pending_window_title_.get() |
| 306 withNewTitle:newTitle | 306 withNewTitle:newTitle |
| 307 forWindow:window()]); | 307 forWindow:window()]); |
| 308 } | 308 } |
| 309 | 309 |
| 310 NSString* BrowserWindowCocoa::WindowTitle() { | 310 NSString* BrowserWindowCocoa::WindowTitle() { |
| 311 const bool include_app_name = true; |
| 311 if (alert_state_ == TabAlertState::AUDIO_PLAYING) { | 312 if (alert_state_ == TabAlertState::AUDIO_PLAYING) { |
| 312 return l10n_util::GetNSStringF(IDS_WINDOW_AUDIO_PLAYING_MAC, | 313 return l10n_util::GetNSStringF(IDS_WINDOW_AUDIO_PLAYING_MAC, |
| 313 browser_->GetWindowTitleForCurrentTab(), | 314 browser_->GetWindowTitleForCurrentTab( |
| 315 include_app_name), |
| 314 base::SysNSStringToUTF16(@"🔊")); | 316 base::SysNSStringToUTF16(@"🔊")); |
| 315 } else if (alert_state_ == TabAlertState::AUDIO_MUTING) { | 317 } else if (alert_state_ == TabAlertState::AUDIO_MUTING) { |
| 316 return l10n_util::GetNSStringF(IDS_WINDOW_AUDIO_MUTING_MAC, | 318 return l10n_util::GetNSStringF(IDS_WINDOW_AUDIO_MUTING_MAC, |
| 317 browser_->GetWindowTitleForCurrentTab(), | 319 browser_->GetWindowTitleForCurrentTab( |
| 320 include_app_name), |
| 318 base::SysNSStringToUTF16(@"🔇")); | 321 base::SysNSStringToUTF16(@"🔇")); |
| 319 } | 322 } |
| 320 return base::SysUTF16ToNSString(browser_->GetWindowTitleForCurrentTab()); | 323 return base::SysUTF16ToNSString( |
| 324 browser_->GetWindowTitleForCurrentTab(include_app_name)); |
| 321 } | 325 } |
| 322 | 326 |
| 323 void BrowserWindowCocoa::BookmarkBarStateChanged( | 327 void BrowserWindowCocoa::BookmarkBarStateChanged( |
| 324 BookmarkBar::AnimateChangeType change_type) { | 328 BookmarkBar::AnimateChangeType change_type) { |
| 325 [[controller_ bookmarkBarController] | 329 [[controller_ bookmarkBarController] |
| 326 updateState:browser_->bookmark_bar_state() | 330 updateState:browser_->bookmark_bar_state() |
| 327 changeType:change_type]; | 331 changeType:change_type]; |
| 328 } | 332 } |
| 329 | 333 |
| 330 void BrowserWindowCocoa::UpdateDevTools() { | 334 void BrowserWindowCocoa::UpdateDevTools() { |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { | 841 ExclusiveAccessContext* BrowserWindowCocoa::GetExclusiveAccessContext() { |
| 838 return [controller_ exclusiveAccessController]; | 842 return [controller_ exclusiveAccessController]; |
| 839 } | 843 } |
| 840 | 844 |
| 841 void BrowserWindowCocoa::ShowImeWarningBubble( | 845 void BrowserWindowCocoa::ShowImeWarningBubble( |
| 842 const extensions::Extension* extension, | 846 const extensions::Extension* extension, |
| 843 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& | 847 const base::Callback<void(ImeWarningBubblePermissionStatus status)>& |
| 844 callback) { | 848 callback) { |
| 845 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; | 849 NOTREACHED() << "The IME warning bubble is unsupported on this platform."; |
| 846 } | 850 } |
| OLD | NEW |