| 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 "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 #include "app/mac/nsimage_cache.h" | 10 #include "app/mac/nsimage_cache.h" |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 // For a popup window, the toolbar is really just a location bar | 279 // For a popup window, the toolbar is really just a location bar |
| 280 // (see override for [ToolbarController view], below). When going | 280 // (see override for [ToolbarController view], below). When going |
| 281 // fullscreen, we remove the toolbar controller's view from the view | 281 // fullscreen, we remove the toolbar controller's view from the view |
| 282 // hierarchy. Calling [locationBar_ removeFromSuperview] when going | 282 // hierarchy. Calling [locationBar_ removeFromSuperview] when going |
| 283 // fullscreen causes it to get released, making us unhappy | 283 // fullscreen causes it to get released, making us unhappy |
| 284 // (http://crbug.com/18551). We avoid the problem by incrementing | 284 // (http://crbug.com/18551). We avoid the problem by incrementing |
| 285 // the retain count of the location bar; use of the scoped object | 285 // the retain count of the location bar; use of the scoped object |
| 286 // helps us remember to release it. | 286 // helps us remember to release it. |
| 287 locationBarRetainer_.reset([locationBar_ retain]); | 287 locationBarRetainer_.reset([locationBar_ retain]); |
| 288 trackingArea_.reset( | 288 trackingArea_.reset( |
| 289 [[NSTrackingArea alloc] initWithRect:NSZeroRect // Ignored | 289 [[CrTrackingArea alloc] initWithRect:NSZeroRect // Ignored |
| 290 options:NSTrackingMouseMoved | | 290 options:NSTrackingMouseMoved | |
| 291 NSTrackingInVisibleRect | | 291 NSTrackingInVisibleRect | |
| 292 NSTrackingMouseEnteredAndExited | | 292 NSTrackingMouseEnteredAndExited | |
| 293 NSTrackingActiveAlways | 293 NSTrackingActiveAlways |
| 294 owner:self | 294 proxiedOwner:self |
| 295 userInfo:nil]); | 295 userInfo:nil]); |
| 296 NSView* toolbarView = [self view]; | 296 NSView* toolbarView = [self view]; |
| 297 [toolbarView addTrackingArea:trackingArea_.get()]; | 297 [toolbarView addTrackingArea:trackingArea_.get()]; |
| 298 | 298 |
| 299 // If the user has any Browser Actions installed, the container view for them | 299 // If the user has any Browser Actions installed, the container view for them |
| 300 // may have to be resized depending on the width of the toolbar frame. | 300 // may have to be resized depending on the width of the toolbar frame. |
| 301 [toolbarView setPostsFrameChangedNotifications:YES]; | 301 [toolbarView setPostsFrameChangedNotifications:YES]; |
| 302 [[NSNotificationCenter defaultCenter] | 302 [[NSNotificationCenter defaultCenter] |
| 303 addObserver:self | 303 addObserver:self |
| 304 selector:@selector(toolbarFrameChanged) | 304 selector:@selector(toolbarFrameChanged) |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { | 790 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { |
| 791 // Do nothing. | 791 // Do nothing. |
| 792 } | 792 } |
| 793 | 793 |
| 794 // (URLDropTargetController protocol) | 794 // (URLDropTargetController protocol) |
| 795 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 795 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 796 // Do nothing. | 796 // Do nothing. |
| 797 } | 797 } |
| 798 | 798 |
| 799 @end | 799 @end |
| OLD | NEW |