Chromium Code Reviews| 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..8bd34d40bbad5c8b9e32ed1caf545099a1f7cff9 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,7 @@ class ExtensionIconLoaderBridge : public extensions::IconImage::Observer { |
| styleMask:NSBorderlessWindowMask |
| backing:NSBackingStoreBuffered |
| defer:NO]); |
| + [window setAllowedAnimations:info_bubble::kAnimateNone]; |
| if (self = [super initWithWindow:window |
| parentWindow:parent |
| anchoredAt:point]) { |
| @@ -106,9 +109,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( |
| + ui::NativeTheme::kColorId_DialogBackground))]; |
| [self performLayout]; |
| } |
| return self; |
| @@ -158,14 +162,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; |
|
Scott Hess - ex-Googler
2013/02/27 15:22:10
Is this the same on hidpi? I'd say "probably", bu
sail
2013/02/27 18:48:18
Yea this is correct in hidpi mode. For example, th
|
| // 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( |
| + ui::NativeTheme::kColorId_MenuSeparatorColor))]; |
| [contentView addSubview:separatorView]; |
| yOffset += kVerticalPadding; |
| } else { |
| @@ -396,7 +403,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( |
| + ui::NativeTheme::kColorId_FocusedMenuItemBackgroundColor)); |
|
Scott Hess - ex-Googler
2013/02/27 15:22:10
This wad of code seems like it's just dying for a
sail
2013/02/27 18:48:18
Done.
|
| } else { |
| backgroundColor = [NSColor clearColor]; |
| } |