| 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/browser_window_utils.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
| 6 | 6 |
| 7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 return; | 193 return; |
| 194 | 194 |
| 195 // Select previous active window if this is the current active window. | 195 // Select previous active window if this is the current active window. |
| 196 // Otherwise, OSX will always give focus to a Panel window after this one | 196 // Otherwise, OSX will always give focus to a Panel window after this one |
| 197 // is closed because Panels have a higher priority NSWindowLevel. | 197 // is closed because Panels have a higher priority NSWindowLevel. |
| 198 BrowserList::const_reverse_iterator iter = BrowserList::begin_last_active(); | 198 BrowserList::const_reverse_iterator iter = BrowserList::begin_last_active(); |
| 199 BrowserList::const_reverse_iterator end = BrowserList::end_last_active(); | 199 BrowserList::const_reverse_iterator end = BrowserList::end_last_active(); |
| 200 for (; iter != end; ++iter) { | 200 for (; iter != end; ++iter) { |
| 201 Browser* browser = *iter; | 201 Browser* browser = *iter; |
| 202 if (browser != closedBrowser && | 202 if (browser != closedBrowser && |
| 203 !browser->window()->IsMinimized() && |
| 203 [browser->window()->GetNativeHandle() canBecomeKeyWindow]) { | 204 [browser->window()->GetNativeHandle() canBecomeKeyWindow]) { |
| 204 browser->window()->Activate(); | 205 browser->window()->Activate(); |
| 205 return; | 206 return; |
| 206 } | 207 } |
| 207 } | 208 } |
| 208 } | 209 } |
| 209 @end | 210 @end |
| OLD | NEW |