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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm

Issue 2934873002: Omnibox UI Experiments: Add border and shadow to narrow dropdown in Mac. (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
index 53ce50bef7dba4c0c1d80481d2537f47e90129c9..afd88a5051b5518f873e0d3890b3ba9c9f273762 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm
@@ -175,6 +175,10 @@ void OmniboxPopupViewMac::CreatePopupIfNeeded() {
defer:NO]);
[popup_ setBackgroundColor:[NSColor clearColor]];
[popup_ setOpaque:NO];
+ bool narrow_popup =
+ base::FeatureList::IsEnabled(omnibox::kUIExperimentNarrowDropdown);
+ if (narrow_popup)
+ [popup_ setHasShadow:YES];
// Use a flipped view to pin the matrix top the top left. This is needed
// for animated resize.
@@ -196,14 +200,16 @@ void OmniboxPopupViewMac::CreatePopupIfNeeded() {
forDarkTheme:is_dark_theme]);
[background_view_ addSubview:matrix_];
- top_separator_view_.reset(
- [[OmniboxPopupTopSeparatorView alloc] initWithFrame:NSZeroRect]);
- [contentView addSubview:top_separator_view_];
+ if (!narrow_popup) {
+ top_separator_view_.reset(
+ [[OmniboxPopupTopSeparatorView alloc] initWithFrame:NSZeroRect]);
+ [contentView addSubview:top_separator_view_];
- bottom_separator_view_.reset([[OmniboxPopupBottomSeparatorView alloc]
- initWithFrame:NSZeroRect
- forDarkTheme:is_dark_theme]);
- [contentView addSubview:bottom_separator_view_];
+ bottom_separator_view_.reset([[OmniboxPopupBottomSeparatorView alloc]
+ initWithFrame:NSZeroRect
+ forDarkTheme:is_dark_theme]);
+ [contentView addSubview:bottom_separator_view_];
+ }
// TODO(dtseng): Ignore until we provide NSAccessibility support.
[popup_ accessibilitySetOverrideValue:NSAccessibilityUnknownRole
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698