OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import <Cocoa/Cocoa.h> |
| 6 |
| 7 #include "ui/base/cocoa/focus_window_set.h" |
| 8 |
| 9 namespace ui { |
| 10 |
| 11 void FocusWindowSet(std::set<NSWindow*> windows) { |
| 12 NSArray* ordered_windows = [NSApp orderedWindows]; |
| 13 [NSApp activateIgnoringOtherApps:YES]; |
| 14 NSWindow* last_window = nil; |
| 15 for (int i = [ordered_windows count] - 1; i >= 0; i--) { |
| 16 NSWindow* win = [ordered_windows objectAtIndex:i]; |
| 17 if (windows.find(win) != windows.end()) { |
| 18 [win orderFront:nil]; |
| 19 last_window = win; |
| 20 } |
| 21 } |
| 22 [last_window makeMainWindow]; |
| 23 [last_window makeKeyWindow]; |
| 24 } |
| 25 |
| 26 } // namespace ui |
OLD | NEW |