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

Side by Side Diff: webrtc/base/macwindowpicker.cc

Issue 1644843003: Compile rtc_base_objc and rtc_api_objc for Mac (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright 2010 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2010 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #include "webrtc/base/macwindowpicker.h" 10 #include "webrtc/base/macwindowpicker.h"
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 if (!RunAppleScript(ss.str())) { 153 if (!RunAppleScript(ss.str())) {
154 // This might happen to for example X applications where the X 154 // This might happen to for example X applications where the X
155 // server spawns of processes with their own PID but the X server 155 // server spawns of processes with their own PID but the X server
156 // is still registered as owner to the application windows. As a 156 // is still registered as owner to the application windows. As a
157 // workaround, we put the X server process to front, meaning that 157 // workaround, we put the X server process to front, meaning that
158 // all X applications will show up. The drawback with this 158 // all X applications will show up. The drawback with this
159 // workaround is that the application that we really wanted to set 159 // workaround is that the application that we really wanted to set
160 // to front might be behind another X application. 160 // to front might be behind another X application.
161 ProcessSerialNumber psn; 161 ProcessSerialNumber psn;
162 pid_t pid = pid_val; 162 pid_t pid = pid_val;
163 #pragma clang diagnostic push
164 #pragma clang diagnostic ignored "-Wdeprecated"
163 int res = GetProcessForPID(pid, &psn); 165 int res = GetProcessForPID(pid, &psn);
164 if (res != 0) { 166 if (res != 0) {
165 LOG(LS_ERROR) << "Failed getting process for pid"; 167 LOG(LS_ERROR) << "Failed getting process for pid";
166 result = false; 168 result = false;
167 } 169 }
168 res = SetFrontProcess(&psn); 170 res = SetFrontProcess(&psn);
169 if (res != 0) { 171 if (res != 0) {
170 LOG(LS_ERROR) << "Failed setting process to front"; 172 LOG(LS_ERROR) << "Failed setting process to front";
171 result = false; 173 result = false;
172 } 174 }
175 #pragma clang diagnostic pop
173 } 176 }
174 CFRelease(window_id_array); 177 CFRelease(window_id_array);
175 CFRelease(window_array); 178 CFRelease(window_array);
176 return result; 179 return result;
177 } 180 }
178 181
179 bool MacWindowPicker::GetDesktopList(DesktopDescriptionList* descriptions) { 182 bool MacWindowPicker::GetDesktopList(DesktopDescriptionList* descriptions) {
180 const uint32_t kMaxDisplays = 128; 183 const uint32_t kMaxDisplays = 128;
181 CGDirectDisplayID active_displays[kMaxDisplays]; 184 CGDirectDisplayID active_displays[kMaxDisplays];
182 uint32_t display_count = 0; 185 uint32_t display_count = 0;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 descriptions->push_back(desc); 250 descriptions->push_back(desc);
248 } 251 }
249 } 252 }
250 } 253 }
251 254
252 CFRelease(window_array); 255 CFRelease(window_array);
253 return true; 256 return true;
254 } 257 }
255 258
256 } // namespace rtc 259 } // namespace rtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698