| 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 #import "ui/base/cocoa/tracking_area.h" | 5 #import "ui/base/cocoa/tracking_area.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 // NSTrackingArea does not retain its |owner| so CrTrackingArea wraps the real | 9 // NSTrackingArea does not retain its |owner| so CrTrackingArea wraps the real |
| 10 // owner in this proxy, which can stop forwarding messages to the owner when | 10 // owner in this proxy, which can stop forwarding messages to the owner when |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 @end | 64 @end |
| 65 | 65 |
| 66 //////////////////////////////////////////////////////////////////////////////// | 66 //////////////////////////////////////////////////////////////////////////////// |
| 67 | 67 |
| 68 @implementation CrTrackingArea | 68 @implementation CrTrackingArea |
| 69 | 69 |
| 70 - (id)initWithRect:(NSRect)rect | 70 - (id)initWithRect:(NSRect)rect |
| 71 options:(NSTrackingAreaOptions)options | 71 options:(NSTrackingAreaOptions)options |
| 72 owner:(id)owner | 72 owner:(id)owner |
| 73 userInfo:(NSDictionary*)userInfo { | 73 userInfo:(NSDictionary*)userInfo { |
| 74 scoped_nsobject<CrTrackingAreaOwnerProxy> ownerProxy( | 74 base::scoped_nsobject<CrTrackingAreaOwnerProxy> ownerProxy( |
| 75 [[CrTrackingAreaOwnerProxy alloc] initWithOwner:owner]); | 75 [[CrTrackingAreaOwnerProxy alloc] initWithOwner:owner]); |
| 76 if ((self = [super initWithRect:rect | 76 if ((self = [super initWithRect:rect |
| 77 options:options | 77 options:options |
| 78 owner:ownerProxy.get() | 78 owner:ownerProxy.get() |
| 79 userInfo:userInfo])) { | 79 userInfo:userInfo])) { |
| 80 ownerProxy_.swap(ownerProxy); | 80 ownerProxy_.swap(ownerProxy); |
| 81 } | 81 } |
| 82 return self; | 82 return self; |
| 83 } | 83 } |
| 84 | 84 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 | 121 |
| 122 void ScopedCrTrackingArea::reset(CrTrackingArea* tracking_area) { | 122 void ScopedCrTrackingArea::reset(CrTrackingArea* tracking_area) { |
| 123 tracking_area_.reset(tracking_area); | 123 tracking_area_.reset(tracking_area); |
| 124 } | 124 } |
| 125 | 125 |
| 126 CrTrackingArea* ScopedCrTrackingArea::get() const { | 126 CrTrackingArea* ScopedCrTrackingArea::get() const { |
| 127 return tracking_area_.get(); | 127 return tracking_area_.get(); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace ui | 130 } // namespace ui |
| OLD | NEW |