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

Unified Diff: ui/base/test/windowed_nsnotification_observer.h

Issue 1146873002: [MacViews] Enable dragging a window by its caption/draggable areas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/test/windowed_nsnotification_observer.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/test/windowed_nsnotification_observer.h
diff --git a/ui/base/test/windowed_nsnotification_observer.h b/ui/base/test/windowed_nsnotification_observer.h
new file mode 100644
index 0000000000000000000000000000000000000000..92b897a48458268f711af6ac49c900a005dcb17d
--- /dev/null
+++ b/ui/base/test/windowed_nsnotification_observer.h
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_BASE_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_
+#define UI_BASE_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_
+
+#import <Foundation/Foundation.h>
+
+#import "base/mac/scoped_nsobject.h"
+
+namespace base {
+class RunLoop;
+}
+
+// Like WindowedNotificationObserver in content/public/test/test_utils.h, this
+// starts watching for a notification upon construction and can wait until the
+// notification is observed. This guarantees that a notification fired between
+// calls to init and wait will be caught.
+@interface WindowedNSNotificationObserver : NSObject {
+ @private
+ base::scoped_nsobject<NSString> bundleId_;
+ BOOL notificationReceived_;
+ base::RunLoop* runLoop_;
+}
+
+// Watch for an NSNotification on the default notification center.
+- (id)initForNotification:(NSString*)name;
+
+// Watch for an NSNotification on the shared workspace notification center for
+// the
+// given application.
+- (id)initForWorkspaceNotification:(NSString*)name bundleId:(NSString*)bundleId;
+
+// Returns if the notification has been observed, or spins a RunLoop until it
+// is. Stops observing.
+- (void)wait;
+@end
+
+#endif // UI_BASE_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_
« no previous file with comments | « ui/base/BUILD.gn ('k') | ui/base/test/windowed_nsnotification_observer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698