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

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: Address comments. 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
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..6cea213740222f46bd10a5ac21fe52ead0535d5f
--- /dev/null
+++ b/ui/base/test/windowed_nsnotification_observer.h
@@ -0,0 +1,32 @@
+// 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_GFX_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_
tapted 2015/06/03 07:04:48 UI_GFX_TEST -> UI_BASE_TEST
jackhou1 2015/06/03 08:13:50 Done.
+#define UI_GFX_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_
+
+#import <Cocoa/Cocoa.h>
tapted 2015/06/03 07:04:48 This should be <Foundation/Foundation.h> since App
jackhou1 2015/06/03 08:13:51 Done.
+
+#import "base/mac/scoped_nsobject.h"
+#include "base/memory/scoped_ptr.h"
tapted 2015/06/03 07:04:48 nit: not needed (see below)
jackhou1 2015/06/03 08:13:50 Done.
+#include "base/run_loop.h"
tapted 2015/06/03 07:04:48 nit: forward-declare
jackhou1 2015/06/03 08:13:51 Done.
+
+// Watches for NSNotifications.
tapted 2015/06/03 07:04:49 something more verbose? (i.e. "sell" this class -
jackhou1 2015/06/03 08:13:51 Done.
+@interface WindowedNSNotificationObserver : NSObject {
tapted 2015/06/03 07:04:48 Do you know the history behind the "Windowed" pref
jackhou1 2015/06/03 08:13:51 This is the same as WindowedNotificationObserver i
tapted 2015/06/03 09:12:57 aah, sounds good.
+ @private
+ base::scoped_nsobject<NSString> bundleId_;
+ BOOL notificationReceived_;
+ scoped_ptr<base::RunLoop> runLoop_;
tapted 2015/06/03 07:04:48 This can just be a raw pointer to base::RunLoop (s
jackhou1 2015/06/03 08:13:51 Done.
+}
+
+// Watch for a notification on the default notification center.
tapted 2015/06/03 07:04:48 nit: "a notification" -> "an NSNotification"
jackhou1 2015/06/03 08:13:51 Done.
+- (id)initForNotification:(NSString*)name;
+// Watch for a notification on the shared workspace notification center for the
tapted 2015/06/03 07:04:48 nit: blank line before
jackhou1 2015/06/03 08:13:51 Done.
+// given application.
+- (id)initForNotification:(NSString*)name
tapted 2015/06/03 07:04:48 maybe `initForWorkspaceNotification`?
jackhou1 2015/06/03 08:13:51 Done.
+ andBundleId:(NSString*)bundleId;
tapted 2015/06/03 07:04:48 andBundleId -> bundleId (or maybe `forBundleId` b
jackhou1 2015/06/03 08:13:50 Done.
+- (void)wait;
tapted 2015/06/03 07:04:48 needs a comment. Needs to say stuff like ~immediat
jackhou1 2015/06/03 08:13:51 Done.
+@end
+
+#endif // UI_GFX_TEST_WINDOWED_NSNOTIFICATION_OBSERVER_H_
+
tapted 2015/06/03 07:04:48 nit: remove extra blank line
jackhou1 2015/06/03 08:13:51 Done.

Powered by Google App Engine
This is Rietveld 408576698