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

Unified Diff: chrome/browser/ui/cocoa/tracking_area.h

Issue 6486002: [Mac] Create CrTrackingArea and use it in TabStripController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/tracking_area.h
diff --git a/chrome/browser/ui/cocoa/tracking_area.h b/chrome/browser/ui/cocoa/tracking_area.h
new file mode 100644
index 0000000000000000000000000000000000000000..26cb2eff778b4412fc1aa9f434f45b948ee5df88
--- /dev/null
+++ b/chrome/browser/ui/cocoa/tracking_area.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2011 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 CHROME_BROWSER_UI_COCOA_TRACKING_AREA_H_
+#define CHROME_BROWSER_UI_COCOA_TRACKING_AREA_H_
+
+#import <AppKit/AppKit.h>
+
+#include "base/scoped_nsobject.h"
+
+@class CrTrackingAreaOwnerProxy;
+
+// The CrTrackingArea can be used in place of an NSTrackingArea to shut off
+// messaging to the |owner| at a specific point in time.
+@interface CrTrackingArea : NSTrackingArea {
+ @private
+ scoped_nsobject<CrTrackingAreaOwnerProxy> ownerProxy_;
+}
+
+// Designated initializer. Forwards all arguments to the superclass, but wraps
+// |owner| in a proxy object.
+- (id)initWithRect:(NSRect)rect
+ options:(NSTrackingAreaOptions)options
+ owner:(id)owner
+ userInfo:(NSDictionary*)userInfo;
+
+// Prevents any future messages from being delivered to the |owner|.
+- (void)clearOwner;
+
+// Watches |window| for its NSWindowWillCloseNotification and calls
+// |-clearOwner| when the notification is observed.
+- (void)clearOwnerWhenWindowWillClose:(NSWindow*)window;
+
+@end
+
+#endif // CHROME_BROWSER_UI_COCOA_TRACKING_AREA_H_

Powered by Google App Engine
This is Rietveld 408576698