OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef UI_BASE_COCOA_TRACKING_AREA_H_ | 5 #ifndef UI_BASE_COCOA_TRACKING_AREA_H_ |
6 #define UI_BASE_COCOA_TRACKING_AREA_H_ | 6 #define UI_BASE_COCOA_TRACKING_AREA_H_ |
7 | 7 |
8 #import <AppKit/AppKit.h> | 8 #import <AppKit/AppKit.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
11 #include "ui/base/ui_export.h" | 11 #include "ui/base/ui_export.h" |
12 | 12 |
13 @class CrTrackingAreaOwnerProxy; | 13 @class CrTrackingAreaOwnerProxy; |
14 | 14 |
15 // The CrTrackingArea can be used in place of an NSTrackingArea to shut off | 15 // The CrTrackingArea can be used in place of an NSTrackingArea to shut off |
16 // messaging to the |owner| at a specific point in time. | 16 // messaging to the |owner| at a specific point in time. |
17 UI_EXPORT | 17 UI_EXPORT |
18 @interface CrTrackingArea : NSTrackingArea { | 18 @interface CrTrackingArea : NSTrackingArea { |
19 @private | 19 @private |
20 scoped_nsobject<CrTrackingAreaOwnerProxy> ownerProxy_; | 20 base::scoped_nsobject<CrTrackingAreaOwnerProxy> ownerProxy_; |
21 } | 21 } |
22 | 22 |
23 // Designated initializer. Forwards all arguments to the superclass, but wraps | 23 // Designated initializer. Forwards all arguments to the superclass, but wraps |
24 // |owner| in a proxy object. | 24 // |owner| in a proxy object. |
25 - (id)initWithRect:(NSRect)rect | 25 - (id)initWithRect:(NSRect)rect |
26 options:(NSTrackingAreaOptions)options | 26 options:(NSTrackingAreaOptions)options |
27 owner:(id)owner | 27 owner:(id)owner |
28 userInfo:(NSDictionary*)userInfo; | 28 userInfo:(NSDictionary*)userInfo; |
29 | 29 |
30 // Prevents any future messages from being delivered to the |owner|. | 30 // Prevents any future messages from being delivered to the |owner|. |
(...skipping 18 matching lines...) Expand all Loading... |
49 ~ScopedCrTrackingArea(); | 49 ~ScopedCrTrackingArea(); |
50 | 50 |
51 // This will call |scoped_nsobject<>::reset()| to take ownership of the new | 51 // This will call |scoped_nsobject<>::reset()| to take ownership of the new |
52 // tracking area. Note that -clearOwner is NOT called on the existing | 52 // tracking area. Note that -clearOwner is NOT called on the existing |
53 // tracking area. | 53 // tracking area. |
54 void reset(CrTrackingArea* tracking_area = nil); | 54 void reset(CrTrackingArea* tracking_area = nil); |
55 | 55 |
56 CrTrackingArea* get() const; | 56 CrTrackingArea* get() const; |
57 | 57 |
58 private: | 58 private: |
59 scoped_nsobject<CrTrackingArea> tracking_area_; | 59 base::scoped_nsobject<CrTrackingArea> tracking_area_; |
60 DISALLOW_COPY_AND_ASSIGN(ScopedCrTrackingArea); | 60 DISALLOW_COPY_AND_ASSIGN(ScopedCrTrackingArea); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace ui | 63 } // namespace ui |
64 | 64 |
65 #endif // UI_BASE_COCOA_TRACKING_AREA_H_ | 65 #endif // UI_BASE_COCOA_TRACKING_AREA_H_ |
OLD | NEW |