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

Side by Side Diff: chrome/browser/ui/cocoa/tracking_area.h

Issue 6612025: [Mac] Apply CrTrackingArea to the two other places where we get |-mouseMoved:| zombie messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 CHROME_BROWSER_UI_COCOA_TRACKING_AREA_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_TRACKING_AREA_H_
6 #define CHROME_BROWSER_UI_COCOA_TRACKING_AREA_H_ 6 #define CHROME_BROWSER_UI_COCOA_TRACKING_AREA_H_
7 7
8 #import <AppKit/AppKit.h> 8 #import <AppKit/AppKit.h>
9 9
10 #include "base/scoped_nsobject.h" 10 #include "base/scoped_nsobject.h"
(...skipping 23 matching lines...) Expand all
34 34
35 // Prevents any future messages from being delivered to the |owner|. 35 // Prevents any future messages from being delivered to the |owner|.
36 - (void)clearOwner; 36 - (void)clearOwner;
37 37
38 // Watches |window| for its NSWindowWillCloseNotification and calls 38 // Watches |window| for its NSWindowWillCloseNotification and calls
39 // |-clearOwner| when the notification is observed. 39 // |-clearOwner| when the notification is observed.
40 - (void)clearOwnerWhenWindowWillClose:(NSWindow*)window; 40 - (void)clearOwnerWhenWindowWillClose:(NSWindow*)window;
41 41
42 @end 42 @end
43 43
44 // Scoper //////////////////////////////////////////////////////////////////////
45
46 // Use an instance of this class to call |-clearOwner| on the |tracking_area_|
47 // when this goes out of scope.
48 class ScopedCrTrackingArea {
49 public:
50 // Takes ownership of |tracking_area| without retaining it.
51 explicit ScopedCrTrackingArea(CrTrackingArea* tracking_area = nil);
52 ~ScopedCrTrackingArea();
53
54 // This will call |scoped_nsobject<>::reset()| to take ownership of the new
55 // tracking area.
56 void reset(CrTrackingArea* tracking_area = nil);
57
58 CrTrackingArea* get() const;
59
60 private:
61 scoped_nsobject<CrTrackingArea> tracking_area_;
62 DISALLOW_COPY_AND_ASSIGN(ScopedCrTrackingArea);
63 };
64
44 #endif // CHROME_BROWSER_UI_COCOA_TRACKING_AREA_H_ 65 #endif // CHROME_BROWSER_UI_COCOA_TRACKING_AREA_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm ('k') | chrome/browser/ui/cocoa/tracking_area.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698