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

Side by Side Diff: ui/base/test/ui_cocoa_test_helper.mm

Issue 22460011: [CleanUp] Use base::STLSetDifference in place of std::set_difference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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
« no previous file with comments | « net/base/mime_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/base/test/ui_cocoa_test_helper.h" 5 #import "ui/base/test/ui_cocoa_test_helper.h"
6 6
7 #include "base/debug/debugger.h" 7 #include "base/debug/debugger.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/test/test_timeouts.h" 9 #include "base/test/test_timeouts.h"
10 10
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 base::mac::ScopedNSAutoreleasePool pool; 172 base::mac::ScopedNSAutoreleasePool pool;
173 NSArray *appWindows = [NSApp windows]; 173 NSArray *appWindows = [NSApp windows];
174 for (NSWindow *window in appWindows) { 174 for (NSWindow *window in appWindows) {
175 windows.insert(window); 175 windows.insert(window);
176 } 176 }
177 return windows; 177 return windows;
178 } 178 }
179 179
180 std::set<NSWindow*> CocoaTest::WindowsLeft() { 180 std::set<NSWindow*> CocoaTest::WindowsLeft() {
181 const std::set<NSWindow*> windows(ApplicationWindows()); 181 const std::set<NSWindow*> windows(ApplicationWindows());
182 std::set<NSWindow*> windows_left; 182 std::set<NSWindow*> windows_left =
183 std::set_difference(windows.begin(), windows.end(), 183 base::STLSetDifference<NSWindow*>(windows, initial_windows);
Lei Zhang 2013/08/10 08:26:10 typo
Haojian Wu 2013/08/10 09:47:29 Done.
184 initial_windows_.begin(), initial_windows_.end(),
185 std::inserter(windows_left, windows_left.begin()));
186 return windows_left; 184 return windows_left;
187 } 185 }
188 186
189 CocoaTestHelperWindow* CocoaTest::test_window() { 187 CocoaTestHelperWindow* CocoaTest::test_window() {
190 if (!test_window_) { 188 if (!test_window_) {
191 test_window_ = [[CocoaTestHelperWindow alloc] init]; 189 test_window_ = [[CocoaTestHelperWindow alloc] init];
192 if (base::debug::BeingDebugged()) { 190 if (base::debug::BeingDebugged()) {
193 [test_window_ orderFront:nil]; 191 [test_window_ orderFront:nil];
194 } else { 192 } else {
195 [test_window_ orderBack:nil]; 193 [test_window_ orderBack:nil];
196 } 194 }
197 } 195 }
198 return test_window_; 196 return test_window_;
199 } 197 }
200 198
201 } // namespace ui 199 } // namespace ui
OLDNEW
« no previous file with comments | « net/base/mime_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698