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

Side by Side Diff: webrtc/modules/desktop_capture/mac/full_screen_chrome_window_detector.cc

Issue 2479553006: Remove GetWindowList / GetScreenList and SelectWindow / SelectScreen from WebRTC (Closed)
Patch Set: Resolve review comments Created 4 years, 1 month 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 (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 10
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 CGWindowID original_window) { 150 CGWindowID original_window) {
151 if (!IsChromeWindow(original_window) || !IsWindowMinimized(original_window)) 151 if (!IsChromeWindow(original_window) || !IsWindowMinimized(original_window))
152 return kCGNullWindowID; 152 return kCGNullWindowID;
153 153
154 CGWindowID full_screen_window_id = 154 CGWindowID full_screen_window_id =
155 FindFullScreenWindowWithSamePidAndTitle(original_window); 155 FindFullScreenWindowWithSamePidAndTitle(original_window);
156 156
157 if (full_screen_window_id == kCGNullWindowID) 157 if (full_screen_window_id == kCGNullWindowID)
158 return kCGNullWindowID; 158 return kCGNullWindowID;
159 159
160 for (WindowCapturer::WindowList::iterator it = previous_window_list_.begin(); 160 for (const auto& window : previous_window_list_) {
161 it != previous_window_list_.end(); ++it) { 161 if (static_cast<CGWindowID>(window.id) != full_screen_window_id)
162 if (static_cast<CGWindowID>(it->id) != full_screen_window_id)
163 continue; 162 continue;
164 163
165 LOG(LS_WARNING) << "The full-screen window exists in the list."; 164 LOG(LS_WARNING) << "The full-screen window exists in the list.";
166 return kCGNullWindowID; 165 return kCGNullWindowID;
167 } 166 }
168 167
169 return full_screen_window_id; 168 return full_screen_window_id;
170 } 169 }
171 170
172 void FullScreenChromeWindowDetector::UpdateWindowListIfNeeded( 171 void FullScreenChromeWindowDetector::UpdateWindowListIfNeeded(
173 CGWindowID original_window) { 172 CGWindowID original_window) {
174 if (IsChromeWindow(original_window) && 173 if (IsChromeWindow(original_window) &&
175 (rtc::TimeNanos() - last_update_time_ns_) / rtc::kNumNanosecsPerMillisec 174 (rtc::TimeNanos() - last_update_time_ns_) / rtc::kNumNanosecsPerMillisec
176 > kUpdateIntervalMs) { 175 > kUpdateIntervalMs) {
177 previous_window_list_.clear(); 176 previous_window_list_.clear();
178 previous_window_list_.swap(current_window_list_); 177 previous_window_list_.swap(current_window_list_);
179 178
180 // No need to update the window list when the window is minimized. 179 // No need to update the window list when the window is minimized.
181 if (IsWindowMinimized(original_window)) { 180 if (IsWindowMinimized(original_window)) {
182 previous_window_list_.clear(); 181 previous_window_list_.clear();
183 return; 182 return;
184 } 183 }
185 184
186 GetWindowList(&current_window_list_); 185 GetWindowList(&current_window_list_, false);
187 last_update_time_ns_ = rtc::TimeNanos(); 186 last_update_time_ns_ = rtc::TimeNanos();
188 } 187 }
189 } 188 }
190 189
191 } // namespace webrtc 190 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698