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

Unified Diff: Source/web/mac/WebScrollbarTheme.mm

Issue 1245323002: Pass scroll bar placement as an enum instead of std::string (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updates per code review Created 5 years, 5 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 | « Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm ('k') | public/platform/mac/MacScrollTypes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/mac/WebScrollbarTheme.mm
diff --git a/Source/web/mac/WebScrollbarTheme.mm b/Source/web/mac/WebScrollbarTheme.mm
index 08aa8d77801a7bab4360c0b30eca691c467460e4..03b7f0c524f1314f6c76406204712af299135b2a 100644
--- a/Source/web/mac/WebScrollbarTheme.mm
+++ b/Source/web/mac/WebScrollbarTheme.mm
@@ -60,15 +60,25 @@ void WebScrollbarTheme::updateScrollbars(
animation_enabled = [value boolValue];
animation_initialized = true;
}
+ // More temporary logic used until the browser begins to call updateScrollbarsWithNSDefaults method.
NSString* scrollbar_variant = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleScrollBarVariant"];
+ ScrollbarButtonsPlacement buttons_placement;
+ if ([scrollbar_variant isEqualToString:@"Single"])
+ buttons_placement = ScrollbarButtonsPlacementSingle;
+ else if ([scrollbar_variant isEqualToString:@"DoubleMin"])
+ buttons_placement = ScrollbarButtonsPlacementDoubleStart;
+ else if ([scrollbar_variant isEqualToString:@"DoubleBoth"])
+ buttons_placement = ScrollbarButtonsPlacementDoubleBoth;
+ else
+ buttons_placement = ScrollbarButtonsPlacementDoubleEnd;
updateScrollbarsWithNSDefaults(initialButtonDelay, autoscrollButtonDelay,
preferredScrollerStyle, redraw, animation_enabled,
- scrollbar_variant ? [scrollbar_variant UTF8String] : "");
+ buttons_placement);
}
void WebScrollbarTheme::updateScrollbarsWithNSDefaults(
float initialButtonDelay, float autoscrollButtonDelay,
- ScrollerStyle preferredScrollerStyle, bool redraw, bool scrollAnimationEnabled, const std::string& buttonPlacement)
+ ScrollerStyle preferredScrollerStyle, bool redraw, bool scrollAnimationEnabled, ScrollbarButtonsPlacement buttonPlacement)
{
ScrollbarTheme* theme = ScrollbarTheme::theme();
if (theme->isMockTheme())
« no previous file with comments | « Source/platform/scroll/ScrollbarThemeMacOverlayAPI.mm ('k') | public/platform/mac/MacScrollTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698