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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 6486002: [Mac] Create CrTrackingArea and use it in TabStripController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/tabs/tab_strip_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
index 93048d49747adb4278c1d804a0c5666ec7075731..32e04a5a46ba913a8794c62503e9768d9f9ea569 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -31,6 +31,7 @@
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/find_bar/find_manager.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
+#import "chrome/browser/ui/cocoa/chrome_tracking_area.h"
Scott Hess - ex-Googler 2011/02/11 01:17:12 It occurs to me that "chrome" is redundant, and it
Robert Sesek 2011/02/11 02:30:50 Yea, I agree. I was following CrApplication. I'll
#import "chrome/browser/ui/cocoa/constrained_window_mac.h"
#import "chrome/browser/ui/cocoa/new_tab_button.h"
#import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
@@ -122,7 +123,6 @@ private:
} // namespace
@interface TabStripController (Private)
-- (void)installTrackingArea;
- (void)addSubviewToPermanentList:(NSView*)aView;
- (void)regenerateSubviewList;
- (NSInteger)indexForContentsView:(NSView*)view;
@@ -296,6 +296,7 @@ private:
bridge_.reset(new TabStripModelObserverBridge(tabStripModel_, self));
tabContentsArray_.reset([[NSMutableArray alloc] init]);
tabArray_.reset([[NSMutableArray alloc] init]);
+ NSWindow* browserWindow = [view window];
// Important note: any non-tab subviews not added to |permanentSubviews_|
// (see |-addSubviewToPermanentList:|) will be wiped out.
@@ -321,11 +322,12 @@ private:
app::mac::GetCachedImageWithName(kNewTabPressedImage)];
newTabButtonShowingHoverImage_ = NO;
newTabTrackingArea_.reset(
- [[NSTrackingArea alloc] initWithRect:[newTabButton_ bounds]
+ [[CrTrackingArea alloc] initWithRect:[newTabButton_ bounds]
options:(NSTrackingMouseEnteredAndExited |
NSTrackingActiveAlways)
owner:self
userInfo:nil]);
+ [newTabTrackingArea_ clearOwnerWhenWindowWillClose:browserWindow];
[newTabButton_ addTrackingArea:newTabTrackingArea_.get()];
targetFrames_.reset([[NSMutableDictionary alloc] init]);
@@ -350,7 +352,7 @@ private:
name:NSViewFrameDidChangeNotification
object:tabStripView_];
- trackingArea_.reset([[NSTrackingArea alloc]
+ trackingArea_.reset([[CrTrackingArea alloc]
initWithRect:NSZeroRect // Ignored by NSTrackingInVisibleRect
options:NSTrackingMouseEnteredAndExited |
NSTrackingMouseMoved |
@@ -358,6 +360,7 @@ private:
NSTrackingInVisibleRect
owner:self
userInfo:nil]);
+ [trackingArea_ clearOwnerWhenWindowWillClose:browserWindow];
[tabStripView_ addTrackingArea:trackingArea_.get()];
// Check to see if the mouse is currently in our bounds so we can

Powered by Google App Engine
This is Rietveld 408576698