forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 15
/
ui_android_feature_map.cc
33 lines (25 loc) · 1.02 KB
/
ui_android_feature_map.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/android/feature_map.h"
#include "base/feature_list.h"
#include "base/no_destructor.h"
#include "ui/android/ui_android_features.h"
#include "ui/android/ui_android_jni_headers/UiAndroidFeatureMap_jni.h"
namespace ui {
namespace {
// Array of features exposed through the Java UiAndroidFeatureMap API.
const base::Feature* const kFeaturesExposedToJava[] = {
&ui::kConvertTrackpadEventsToMouse, &ui::kDeprecatedExternalPickerFunction,
&ui::kReportAllAvailablePointerTypes};
// static
base::android::FeatureMap* GetFeatureMap() {
static base::NoDestructor<base::android::FeatureMap> kFeatureMap(std::vector(
std::begin(kFeaturesExposedToJava), std::end(kFeaturesExposedToJava)));
return kFeatureMap.get();
}
} // namespace
static jlong JNI_UiAndroidFeatureMap_GetNativeMap(JNIEnv* env) {
return reinterpret_cast<jlong>(GetFeatureMap());
}
} // namespace ui