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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif
#include "components/external_intents/android/external_intents_features.h"
#include <jni.h>
#include <stddef.h>
#include <string>
#include "base/android/jni_string.h"
#include "base/notreached.h"
// Must come after all headers that specialize FromJniType() / ToJniType().
#include "components/external_intents/android/jni_headers/ExternalIntentsFeatures_jni.h"
namespace external_intents {
namespace {
// Array of features exposed through the Java ExternalIntentsFeatures API.
const base::Feature* const kFeaturesExposedToJava[] = {
&kExternalNavigationDebugLogs, &kBlockIntentsToSelf,
&kNavigationCaptureRefactorAndroid, &kAuxiliaryNavigationStaysInBrowser,
&kReparentTopLevelNavigationFromPWA, &kReparentAuxiliaryNavigationFromPWA,
&kAuxiliaryNavigationStaysInPWA};
} // namespace
// Alphabetical:
BASE_FEATURE(kExternalNavigationDebugLogs,
"ExternalNavigationDebugLogs",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kBlockIntentsToSelf,
"BlockIntentsToSelf",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kNavigationCaptureRefactorAndroid,
"NavigationCaptureRefactorAndroid",
base::FEATURE_DISABLED_BY_DEFAULT);
BASE_FEATURE(kAuxiliaryNavigationStaysInBrowser,
"AuxiliaryNavigationStaysInBrowser",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kReparentTopLevelNavigationFromPWA,
"ReparentTopLevelNavigationFromPWA",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kReparentAuxiliaryNavigationFromPWA,
"ReparentAuxiliaryNavigationFromPWA",
base::FEATURE_ENABLED_BY_DEFAULT);
BASE_FEATURE(kAuxiliaryNavigationStaysInPWA,
"AuxiliaryNavigationStaysInPWA",
base::FEATURE_DISABLED_BY_DEFAULT);
static jlong JNI_ExternalIntentsFeatures_GetFeature(JNIEnv* env, jint ordinal) {
return reinterpret_cast<jlong>(kFeaturesExposedToJava[ordinal]);
}
} // namespace external_intents
|