Chromium Code Reviews| Index: chrome/browser/ui/cocoa/browser_window_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm |
| index 0f9b7296a03c4420f1671ce6bcc379ce44020d32..f25a5c79f31576a63a6c6a111c209cb317c02608 100644 |
| --- a/chrome/browser/ui/cocoa/browser_window_controller.mm |
| +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm |
| @@ -598,9 +598,10 @@ bool IsTabDetachingInFullscreenEnabled() { |
| // Called right after our window became the main window. |
| - (void)windowDidBecomeMain:(NSNotification*)notification { |
| - if (chrome::GetLastActiveBrowser() != browser_.get()) { |
| - BrowserList::SetLastActive(browser_.get()); |
| - } |
| + // Set this window as active even if the previously active windows was the |
|
Lei Zhang
2016/08/01 17:29:02
Funny enough, before https://codereview.chromium.o
gayane -on leave until 09-2017
2016/08/02 17:13:44
Yes, there is also this CL https://codereview.chro
|
| + // same one. This is needed for tracking visibility changes of a browser. |
| + BrowserList::SetLastActive(browser_.get()); |
| + |
| // Always saveWindowPositionIfNeeded when becoming main, not just |
| // when |browser_| is not the last active browser. See crbug.com/536280 . |
| [self saveWindowPositionIfNeeded]; |
| @@ -624,6 +625,8 @@ bool IsTabDetachingInFullscreenEnabled() { |
| extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile()) |
| ->set_registry_for_active_window(nullptr); |
| + |
| + BrowserList::NotifyBrowserNoLongerActive(browser_.get()); |
| } |
| // Called when we have been minimized. |