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

Side by Side Diff: chrome/browser/cocoa/toolbar_controller.mm

Issue 260009: Several background pattern fixes on the Mac.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 2 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
« no previous file with comments | « chrome/browser/cocoa/tab_window_controller.mm ('k') | chrome/browser/cocoa/toolbar_view.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/toolbar_controller.h" 5 #import "chrome/browser/cocoa/toolbar_controller.h"
6 6
7 #include "app/l10n_util_mac.h" 7 #include "app/l10n_util_mac.h"
8 #include "base/mac_util.h" 8 #include "base/mac_util.h"
9 #include "base/nsimage_cache_mac.h" 9 #include "base/nsimage_cache_mac.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 owner:self 172 owner:self
173 userInfo:nil]); 173 userInfo:nil]);
174 [[self view] addTrackingArea:trackingArea_.get()]; 174 [[self view] addTrackingArea:trackingArea_.get()];
175 175
176 // We want a dynamic tooltip on the go button, so tell the go button to ask 176 // We want a dynamic tooltip on the go button, so tell the go button to ask
177 // use for the tooltip 177 // use for the tooltip
178 [goButton_ addToolTipRect:[goButton_ bounds] owner:self userData:nil]; 178 [goButton_ addToolTipRect:[goButton_ bounds] owner:self userData:nil];
179 179
180 EncodingMenuControllerDelegate::BuildEncodingMenu(profile_, encodingMenu_); 180 EncodingMenuControllerDelegate::BuildEncodingMenu(profile_, encodingMenu_);
181 } 181 }
182 - (void)removeFromSuperview { 182
183 NSLog(@"remove");
184 }
185 - (void)mouseExited:(NSEvent*)theEvent { 183 - (void)mouseExited:(NSEvent*)theEvent {
186 [[hoveredButton_ cell] setMouseInside:NO animate:YES]; 184 [[hoveredButton_ cell] setMouseInside:NO animate:YES];
187 [hoveredButton_ release]; 185 [hoveredButton_ release];
188 hoveredButton_ = nil; 186 hoveredButton_ = nil;
189 } 187 }
190 188
191 - (NSButton*)hoverButtonForEvent:(NSEvent*)theEvent { 189 - (NSButton*)hoverButtonForEvent:(NSEvent*)theEvent {
192 NSButton* targetView = (NSButton *)[[self view] 190 NSButton* targetView = (NSButton*)[[self view]
193 hitTest:[theEvent locationInWindow]]; 191 hitTest:[theEvent locationInWindow]];
194 192
195 // Only interpret the view as a hoverButton_ if it's both button and has a 193 // Only interpret the view as a hoverButton_ if it's both button and has a
196 // button cell that cares. GradientButtonCell derived cells care. 194 // button cell that cares. GradientButtonCell derived cells care.
197 if (([targetView isKindOfClass:[NSButton class]]) && 195 if (([targetView isKindOfClass:[NSButton class]]) &&
198 ([[targetView cell] 196 ([[targetView cell]
199 respondsToSelector:@selector(setMouseInside:animate:)])) 197 respondsToSelector:@selector(setMouseInside:animate:)]))
200 return targetView; 198 return targetView;
201 return nil; 199 return nil;
202 } 200 }
203 201
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 } 425 }
428 426
429 - (void)setShouldBeCompressed:(BOOL)compressed { 427 - (void)setShouldBeCompressed:(BOOL)compressed {
430 CGFloat newToolbarHeight = kBaseToolbarHeight; 428 CGFloat newToolbarHeight = kBaseToolbarHeight;
431 if (compressed) 429 if (compressed)
432 newToolbarHeight -= kBookmarkBarOverlap; 430 newToolbarHeight -= kBookmarkBarOverlap;
433 431
434 [resizeDelegate_ resizeView:[self view] newHeight:newToolbarHeight]; 432 [resizeDelegate_ resizeView:[self view] newHeight:newToolbarHeight];
435 } 433 }
436 434
437 - (NSString *)view:(NSView *)view 435 - (NSString*)view:(NSView*)view
438 stringForToolTip:(NSToolTipTag)tag 436 stringForToolTip:(NSToolTipTag)tag
439 point:(NSPoint)point 437 point:(NSPoint)point
440 userData:(void *)userData { 438 userData:(void*)userData {
441 DCHECK(view == goButton_); 439 DCHECK(view == goButton_);
442 440
443 // Following chrome/browser/views/go_button.cc: GoButton::GetTooltipText() 441 // Following chrome/browser/views/go_button.cc: GoButton::GetTooltipText()
444 442
445 // Is it currently 'stop'? 443 // Is it currently 'stop'?
446 if ([goButton_ tag] == IDC_STOP) { 444 if ([goButton_ tag] == IDC_STOP) {
447 return l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STOP); 445 return l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STOP);
448 } 446 }
449 447
450 // It is 'go', so see what it would do... 448 // It is 'go', so see what it would do...
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 497
500 NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX, 498 NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX,
501 NSHeight(locationFrame)); 499 NSHeight(locationFrame));
502 gfx::Rect stack_bounds( 500 gfx::Rect stack_bounds(
503 NSRectToCGRect([[self view] convertRect:r toView:nil])); 501 NSRectToCGRect([[self view] convertRect:r toView:nil]));
504 // Inset the bounds to just inside the visible edges (see comment above). 502 // Inset the bounds to just inside the visible edges (see comment above).
505 stack_bounds.Inset(kLocationStackEdgeWidth, 0); 503 stack_bounds.Inset(kLocationStackEdgeWidth, 0);
506 return stack_bounds; 504 return stack_bounds;
507 } 505 }
508 @end 506 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/tab_window_controller.mm ('k') | chrome/browser/cocoa/toolbar_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698