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

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

Issue 434047: o Updates the browser action buttons when a tab is changed. This is needed fo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 setEnabled:commands->IsCommandEnabled(IDC_FORWARD) ? YES : NO]; 297 setEnabled:commands->IsCommandEnabled(IDC_FORWARD) ? YES : NO];
298 [reloadButton_ setEnabled:commands->IsCommandEnabled(IDC_RELOAD) ? YES : NO]; 298 [reloadButton_ setEnabled:commands->IsCommandEnabled(IDC_RELOAD) ? YES : NO];
299 [homeButton_ setEnabled:commands->IsCommandEnabled(IDC_HOME) ? YES : NO]; 299 [homeButton_ setEnabled:commands->IsCommandEnabled(IDC_HOME) ? YES : NO];
300 [starButton_ 300 [starButton_
301 setEnabled:commands->IsCommandEnabled(IDC_BOOKMARK_PAGE) ? YES : NO]; 301 setEnabled:commands->IsCommandEnabled(IDC_BOOKMARK_PAGE) ? YES : NO];
302 } 302 }
303 303
304 - (void)updateToolbarWithContents:(TabContents*)tab 304 - (void)updateToolbarWithContents:(TabContents*)tab
305 shouldRestoreState:(BOOL)shouldRestore { 305 shouldRestoreState:(BOOL)shouldRestore {
306 locationBarView_->Update(tab, shouldRestore ? true : false); 306 locationBarView_->Update(tab, shouldRestore ? true : false);
307
308 if (browserActionsController_.get()) {
309 [browserActionsController_ update];
310 }
307 } 311 }
308 312
309 - (void)setStarredState:(BOOL)isStarred { 313 - (void)setStarredState:(BOOL)isStarred {
310 NSImage* starImage = nil; 314 NSImage* starImage = nil;
311 NSString* toolTip; 315 NSString* toolTip;
312 if (isStarred) { 316 if (isStarred) {
313 starImage = nsimage_cache::ImageNamed(kStarButtonFillingImageName); 317 starImage = nsimage_cache::ImageNamed(kStarButtonFillingImageName);
314 // Cache the string since we'll need it a lot 318 // Cache the string since we'll need it a lot
315 static NSString* starredToolTip = 319 static NSString* starredToolTip =
316 [l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STARRED) retain]; 320 [l10n_util::GetNSStringWithFixup(IDS_TOOLTIP_STARRED) retain];
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 609
606 NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX, 610 NSRect r = NSMakeRect(minX, NSMinY(locationFrame), maxX - minX,
607 NSHeight(locationFrame)); 611 NSHeight(locationFrame));
608 gfx::Rect stack_bounds( 612 gfx::Rect stack_bounds(
609 NSRectToCGRect([[self view] convertRect:r toView:nil])); 613 NSRectToCGRect([[self view] convertRect:r toView:nil]));
610 // Inset the bounds to just inside the visible edges (see comment above). 614 // Inset the bounds to just inside the visible edges (see comment above).
611 stack_bounds.Inset(kLocationStackEdgeWidth, 0); 615 stack_bounds.Inset(kLocationStackEdgeWidth, 0);
612 return stack_bounds; 616 return stack_bounds;
613 } 617 }
614 @end 618 @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