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

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

Issue 448004: Merge 32980 - o Updates the browser action buttons when a tab is changed. Thi... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 years 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/extensions/browser_actions_controller.mm ('k') | no next file » | 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 setEnabled:commands->IsCommandEnabled(IDC_FORWARD) ? YES : NO]; 293 setEnabled:commands->IsCommandEnabled(IDC_FORWARD) ? YES : NO];
294 [reloadButton_ setEnabled:commands->IsCommandEnabled(IDC_RELOAD) ? YES : NO]; 294 [reloadButton_ setEnabled:commands->IsCommandEnabled(IDC_RELOAD) ? YES : NO];
295 [homeButton_ setEnabled:commands->IsCommandEnabled(IDC_HOME) ? YES : NO]; 295 [homeButton_ setEnabled:commands->IsCommandEnabled(IDC_HOME) ? YES : NO];
296 [starButton_ 296 [starButton_
297 setEnabled:commands->IsCommandEnabled(IDC_BOOKMARK_PAGE) ? YES : NO]; 297 setEnabled:commands->IsCommandEnabled(IDC_BOOKMARK_PAGE) ? YES : NO];
298 } 298 }
299 299
300 - (void)updateToolbarWithContents:(TabContents*)tab 300 - (void)updateToolbarWithContents:(TabContents*)tab
301 shouldRestoreState:(BOOL)shouldRestore { 301 shouldRestoreState:(BOOL)shouldRestore {
302 locationBarView_->Update(tab, shouldRestore ? true : false); 302 locationBarView_->Update(tab, shouldRestore ? true : false);
303
304 if (browserActionsController_.get()) {
305 [browserActionsController_ update];
306 }
303 } 307 }
304 308
305 - (void)setStarredState:(BOOL)isStarred { 309 - (void)setStarredState:(BOOL)isStarred {
306 NSImage* starImage = nil; 310 NSImage* starImage = nil;
307 NSString* toolTip; 311 NSString* toolTip;
308 if (isStarred) { 312 if (isStarred) {
309 starImage = nsimage_cache::ImageNamed(kStarButtonFillingImageName); 313 starImage = nsimage_cache::ImageNamed(kStarButtonFillingImageName);
310 // Cache the string since we'll need it a lot 314 // Cache the string since we'll need it a lot
311 static NSString* starredToolTip = 315 static NSString* starredToolTip =
312 [l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STARRED) retain]; 316 [l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STARRED) retain];
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 605
602 NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX, 606 NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX,
603 NSHeight(locationFrame)); 607 NSHeight(locationFrame));
604 gfx::Rect stack_bounds( 608 gfx::Rect stack_bounds(
605 NSRectToCGRect([[self view] convertRect:r toView:nil])); 609 NSRectToCGRect([[self view] convertRect:r toView:nil]));
606 // Inset the bounds to just inside the visible edges (see comment above). 610 // Inset the bounds to just inside the visible edges (see comment above).
607 stack_bounds.Inset(kLocationStackEdgeWidth, 0); 611 stack_bounds.Inset(kLocationStackEdgeWidth, 0);
608 return stack_bounds; 612 return stack_bounds;
609 } 613 }
610 @end 614 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/extensions/browser_actions_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698