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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm

Issue 10825447: chrome/browser should build on the x86_64 architecture (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebased on the updated trunk. Created 8 years, 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "browser_actions_controller.h" 5 #import "browser_actions_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <string> 8 #include <string>
9 9
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 for (BrowserActionButton* button in [buttons_ allValues]) { 581 for (BrowserActionButton* button in [buttons_ allValues]) {
582 NSRect buttonFrame = [button frame]; 582 NSRect buttonFrame = [button frame];
583 if (NSContainsRect([containerView_ bounds], buttonFrame)) { 583 if (NSContainsRect([containerView_ bounds], buttonFrame)) {
584 if ([button alphaValue] != 1.0) 584 if ([button alphaValue] != 1.0)
585 [button setAlphaValue:1.0]; 585 [button setAlphaValue:1.0];
586 586
587 continue; 587 continue;
588 } 588 }
589 CGFloat intersectionWidth = 589 CGFloat intersectionWidth =
590 NSWidth(NSIntersectionRect([containerView_ bounds], buttonFrame)); 590 NSWidth(NSIntersectionRect([containerView_ bounds], buttonFrame));
591 CGFloat alpha = std::max(0.0f, intersectionWidth / NSWidth(buttonFrame)); 591 CGFloat alpha = std::max(static_cast<CGFloat>(0.0),
592 intersectionWidth / NSWidth(buttonFrame));
592 [button setAlphaValue:alpha]; 593 [button setAlphaValue:alpha];
593 [button setNeedsDisplay:YES]; 594 [button setNeedsDisplay:YES];
594 } 595 }
595 } 596 }
596 597
597 - (BrowserActionButton*)buttonForExtension:(const Extension*)extension { 598 - (BrowserActionButton*)buttonForExtension:(const Extension*)extension {
598 NSString* extensionId = base::SysUTF8ToNSString(extension->id()); 599 NSString* extensionId = base::SysUTF8ToNSString(extension->id());
599 DCHECK(extensionId); 600 DCHECK(extensionId);
600 if (!extensionId) 601 if (!extensionId)
601 return nil; 602 return nil;
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
862 const extensions::ExtensionList& toolbar_items = 863 const extensions::ExtensionList& toolbar_items =
863 toolbarModel_->toolbar_items(); 864 toolbarModel_->toolbar_items();
864 if (index < toolbar_items.size()) { 865 if (index < toolbar_items.size()) {
865 const Extension* extension = toolbar_items[index]; 866 const Extension* extension = toolbar_items[index];
866 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())]; 867 return [buttons_ objectForKey:base::SysUTF8ToNSString(extension->id())];
867 } 868 }
868 return nil; 869 return nil;
869 } 870 }
870 871
871 @end 872 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.mm ('k') | chrome/browser/ui/cocoa/history_menu_bridge.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698