Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: ui/base/cocoa/focus_window_set.mm

Issue 12723011: Giving focus to an app shim brings windows belonging to that app to the foreground. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698