 Chromium Code Reviews
 Chromium Code Reviews Issue 12315069:
  Mac: Update zoom bubble UI  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src
    
  
    Issue 12315069:
  Mac: Update zoom bubble UI  (Closed) 
  Base URL: svn://svn.chromium.org/chrome/trunk/src| Index: chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm | 
| diff --git a/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm b/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm | 
| index bfb87d125bc067932367aa020086156f8e81cf8e..0c4f6d957d583e7dbe5c1608b3e518a9df5906e5 100644 | 
| --- a/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm | 
| +++ b/chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.mm | 
| @@ -19,10 +19,12 @@ | 
| #include "chrome/common/extensions/extension_constants.h" | 
| #include "grit/generated_resources.h" | 
| #include "grit/theme_resources.h" | 
| +#include "skia/ext/skia_utils_mac.h" | 
| #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" | 
| #include "ui/base/resource/resource_bundle.h" | 
| #include "ui/gfx/image/image.h" | 
| #include "ui/gfx/image/image_skia_util_mac.h" | 
| +#include "ui/native_theme/native_theme.h" | 
| @interface ActionBoxMenuBubbleController (Private) | 
| - (id)highlightedItem; | 
| @@ -98,6 +100,8 @@ class ExtensionIconLoaderBridge : public extensions::IconImage::Observer { | 
| styleMask:NSBorderlessWindowMask | 
| backing:NSBackingStoreBuffered | 
| defer:NO]); | 
| + [window setEnableAnimations:NO]; | 
| + [window setDelayOnClose:NO]; | 
| if (self = [super initWithWindow:window | 
| parentWindow:parent | 
| anchoredAt:point]) { | 
| @@ -106,9 +110,10 @@ class ExtensionIconLoaderBridge : public extensions::IconImage::Observer { | 
| [[self bubble] setAlignment:info_bubble::kAlignRightEdgeToAnchorEdge]; | 
| [[self bubble] setArrowLocation:info_bubble::kNoArrow]; | 
| + ui::NativeTheme *nativeTheme = ui::NativeTheme::instance(); | 
| [[self bubble] setBackgroundColor: | 
| - [NSColor colorWithDeviceWhite:(251.0f/255.0f) | 
| - alpha:1.0]]; | 
| + gfx::SkColorToCalibratedNSColor(nativeTheme-> GetSystemColor( | 
| 
Robert Sesek
2013/02/26 16:08:24
nit: space after ->
 
sail
2013/02/26 22:04:15
Done.
 | 
| + ui::NativeTheme::kColorId_DialogBackground))]; | 
| [self performLayout]; | 
| } | 
| return self; | 
| @@ -158,14 +163,17 @@ class ExtensionIconLoaderBridge : public extensions::IconImage::Observer { | 
| CGFloat minX = NSMinX([contentView bounds]); | 
| for (int i = model_->GetItemCount() - 1; i >= 0; --i) { | 
| if (model_->GetTypeAt(i) == ui::MenuModel::TYPE_SEPARATOR) { | 
| + const CGFloat kSeparatorHeight = 1.0; | 
| // Only supports one separator. | 
| DCHECK(!separatorView); | 
| - yOffset += kVerticalPadding; | 
| + yOffset += kVerticalPadding + kSeparatorHeight; | 
| separatorView.reset([[NSBox alloc] | 
| - initWithFrame:NSMakeRect(0, yOffset, width, 1)]); | 
| - [separatorView setBorderType:NSNoBorder]; | 
| + initWithFrame:NSMakeRect(0, yOffset, width, kSeparatorHeight)]); | 
| [separatorView setBoxType:NSBoxCustom]; | 
| - [separatorView setFillColor:[NSColor grayColor]]; | 
| + ui::NativeTheme *nativeTheme = ui::NativeTheme::instance(); | 
| + [separatorView setBorderColor: | 
| + gfx::SkColorToCalibratedNSColor(nativeTheme-> GetSystemColor( | 
| 
Robert Sesek
2013/02/26 16:08:24
->
 
sail
2013/02/26 22:04:15
Done.
 | 
| + ui::NativeTheme::kColorId_MenuSeparatorColor))]; | 
| [contentView addSubview:separatorView]; | 
| yOffset += kVerticalPadding; | 
| } else { | 
| @@ -396,7 +404,10 @@ class ExtensionIconLoaderBridge : public extensions::IconImage::Observer { | 
| - (void)drawRect:(NSRect)dirtyRect { | 
| NSColor* backgroundColor = nil; | 
| if ([viewController_ isHighlighted]) { | 
| - backgroundColor = [NSColor colorWithDeviceWhite:0.0 alpha:kSelectionAlpha]; | 
| + ui::NativeTheme *nativeTheme = ui::NativeTheme::instance(); | 
| + backgroundColor = gfx::SkColorToCalibratedNSColor( | 
| + nativeTheme-> GetSystemColor( | 
| 
Robert Sesek
2013/02/26 16:08:24
->
 
sail
2013/02/26 22:04:15
Done.
 | 
| + ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor)); | 
| } else { | 
| backgroundColor = [NSColor clearColor]; | 
| } |