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

Unified Diff: content/browser/theme_helper_mac.mm

Issue 1653003002: Make scrollAnimatorEnabled work on Mac like it does on other platforms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Previous patch accidentally lost new files Created 4 years, 10 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 | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/theme_helper_mac.mm
diff --git a/content/browser/theme_helper_mac.mm b/content/browser/theme_helper_mac.mm
index aa5ebd05a0d2fadd8a334ee871dc5e5da691d395..8ae332ed6e04af3afc1af8a9567577d865080126 100644
--- a/content/browser/theme_helper_mac.mm
+++ b/content/browser/theme_helper_mac.mm
@@ -10,6 +10,7 @@
#include "base/mac/mac_util.h"
#include "base/mac/sdk_forward_declarations.h"
#include "base/strings/sys_string_conversions.h"
+#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -18,25 +19,11 @@
#include "content/public/common/content_switches.h"
using content::RenderProcessHost;
+using content::RenderProcessHostImpl;
using content::ThemeHelperMac;
namespace {
-bool GetScrollAnimationEnabled() {
- bool enabled = false;
- id value = nil;
- if (base::mac::IsOSMountainLionOrLater()) {
- value = [[NSUserDefaults standardUserDefaults]
- objectForKey:@"NSScrollAnimationEnabled"];
- } else {
- value = [[NSUserDefaults standardUserDefaults]
- objectForKey:@"AppleScrollAnimationEnabled"];
- }
- if (value)
- enabled = [value boolValue];
- return enabled;
-}
-
blink::WebScrollbarButtonsPlacement GetButtonPlacement() {
NSString* scrollbar_variant = [[NSUserDefaults standardUserDefaults]
objectForKey:@"AppleScrollBarVariant"];
@@ -64,7 +51,6 @@ void FillScrollbarThemeParams(ViewMsg_UpdateScrollbarTheme_Params* params) {
[defaults boolForKey:@"AppleScrollerPagingBehavior"];
params->preferred_scroller_style =
ThemeHelperMac::GetPreferredScrollerStyle();
- params->scroll_animation_enabled = GetScrollAnimationEnabled();
params->button_placement = GetButtonPlacement();
}
@@ -177,7 +163,10 @@ ViewMsg_SystemColorsChanged* CreateSystemColorsChangedMessage() {
for (RenderProcessHost::iterator it(RenderProcessHost::AllHostsIterator());
!it.IsAtEnd();
it.Advance()) {
- it.GetCurrentValue()->Send(new ViewMsg_UpdateScrollbarTheme(params));
+ RenderProcessHostImpl* rphi =
+ static_cast<RenderProcessHostImpl*>(it.GetCurrentValue());
+ rphi->RecomputeAndUpdateWebKitPreferences();
+ rphi->Send(new ViewMsg_UpdateScrollbarTheme(params));
}
}
@@ -219,9 +208,11 @@ void ThemeHelperMac::Observe(int type,
FillScrollbarThemeParams(&params);
params.redraw = false;
- RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr();
- rph->Send(new ViewMsg_UpdateScrollbarTheme(params));
- rph->Send(CreateSystemColorsChangedMessage());
+ RenderProcessHostImpl* rphi =
+ Source<content::RenderProcessHostImpl>(source).ptr();
+ rphi->RecomputeAndUpdateWebKitPreferences();
+ rphi->Send(new ViewMsg_UpdateScrollbarTheme(params));
+ rphi->Send(CreateSystemColorsChangedMessage());
}
} // namespace content
« no previous file with comments | « content/browser/renderer_host/render_view_host_impl.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698