Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/app_list/cocoa/apps_grid_view_item.h" | 5 #import "ui/app_list/cocoa/apps_grid_view_item.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/memory/scoped_nsobject.h" | 8 #include "base/memory/scoped_nsobject.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "skia/ext/skia_utils_mac.h" | 10 #include "skia/ext/skia_utils_mac.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 172 if (!itemModel) { | 172 if (!itemModel) { |
| 173 observerBridge_.reset(); | 173 observerBridge_.reset(); |
| 174 return; | 174 return; |
| 175 } | 175 } |
| 176 | 176 |
| 177 NSButton* button = [self button]; | 177 NSButton* button = [self button]; |
| 178 [button setTitle:base::SysUTF8ToNSString(itemModel->title())]; | 178 [button setTitle:base::SysUTF8ToNSString(itemModel->title())]; |
| 179 [button setImage:gfx::NSImageFromImageSkia(itemModel->icon())]; | 179 [button setImage:gfx::NSImageFromImageSkia(itemModel->icon())]; |
| 180 observerBridge_.reset(new app_list::ItemModelObserverBridge(self, itemModel)); | 180 observerBridge_.reset(new app_list::ItemModelObserverBridge(self, itemModel)); |
| 181 | 181 |
| 182 if (trackingArea_.get()) | 182 if (trackingArea_) |
|
xiyuan
2013/04/16 22:37:20
This is probably does not compile. |trackingArea_|
tfarina
2013/04/16 23:15:48
backed out.
| |
| 183 [[self view] removeTrackingArea:trackingArea_.get()]; | 183 [[self view] removeTrackingArea:trackingArea_.get()]; |
| 184 | 184 |
| 185 trackingArea_.reset( | 185 trackingArea_.reset( |
| 186 [[CrTrackingArea alloc] initWithRect:NSZeroRect | 186 [[CrTrackingArea alloc] initWithRect:NSZeroRect |
| 187 options:NSTrackingInVisibleRect | | 187 options:NSTrackingInVisibleRect | |
| 188 NSTrackingMouseEnteredAndExited | | 188 NSTrackingMouseEnteredAndExited | |
| 189 NSTrackingActiveInKeyWindow | 189 NSTrackingActiveInKeyWindow |
| 190 owner:self | 190 owner:self |
| 191 userInfo:nil]); | 191 userInfo:nil]); |
| 192 [[self view] addTrackingArea:trackingArea_.get()]; | 192 [[self view] addTrackingArea:trackingArea_.get()]; |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 213 - (void)mouseExited:(NSEvent*)theEvent { | 213 - (void)mouseExited:(NSEvent*)theEvent { |
| 214 [self setSelected:NO]; | 214 [self setSelected:NO]; |
| 215 } | 215 } |
| 216 | 216 |
| 217 - (void)setSelected:(BOOL)flag { | 217 - (void)setSelected:(BOOL)flag { |
| 218 [[self itemBackgroundView] setSelected:flag]; | 218 [[self itemBackgroundView] setSelected:flag]; |
| 219 [super setSelected:flag]; | 219 [super setSelected:flag]; |
| 220 } | 220 } |
| 221 | 221 |
| 222 @end | 222 @end |
| OLD | NEW |