Commit b31b3a75 authored by Daniel Bratell's avatar Daniel Bratell Committed by Commit Bot

Reuse existing constants for Android SDK versions

There are constants for Android SDK versions in build_info.h
so nobody has to declare their own. This changes some duplicated
custom constants that clashed in jumbo builds to use the
global constants.

Bug: 598880
Change-Id: I32bc147729e561130eaaf4feab545bd0cd9714c1
Reviewed-on: https://chromium-review.googlesource.com/975641Reviewed-by: default avatarBo <boliu@chromium.org>
Commit-Queue: Daniel Bratell <bratell@opera.com>
Cr-Commit-Position: refs/heads/master@{#545069}
parent ac24ea47
......@@ -33,18 +33,17 @@ using ui::OverscrollRefresh;
namespace content {
namespace {
// Used for conditional creation of EdgeEffect types for the overscroll glow.
const int kAndroidLSDKVersion = 21;
// If the glow effect alpha is greater than this value, the refresh effect will
// be suppressed. This value was experimentally determined to provide a
// reasonable balance between avoiding accidental refresh activation and
// minimizing the wait required to refresh after the glow has been triggered.
const float kMinGlowAlphaToDisableRefreshOnL = 0.085f;
// Used for conditional creation of EdgeEffect types for the overscroll glow.
bool IsAndroidLOrNewer() {
static bool android_l_or_newer =
base::android::BuildInfo::GetInstance()->sdk_int() >= kAndroidLSDKVersion;
base::android::BuildInfo::GetInstance()->sdk_int() >=
base::android::SDK_VERSION_LOLLIPOP;
return android_l_or_newer;
}
......
......@@ -44,8 +44,6 @@ namespace content {
namespace {
const int kAndroidLSDKVersion = 21;
// True if we want to disable Android native event batching and use
// compositor event queue.
bool ShouldRequestUnbufferedDispatch() {
......@@ -53,7 +51,7 @@ bool ShouldRequestUnbufferedDispatch() {
base::FeatureList::IsEnabled(
content::android::kRequestUnbufferedDispatch) &&
base::android::BuildInfo::GetInstance()->sdk_int() >=
kAndroidLSDKVersion &&
base::android::SDK_VERSION_LOLLIPOP &&
!content::GetContentClient()->UsingSynchronousCompositing();
return should_request_unbuffered_dispatch;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment