Commit e47822a1 authored by Filip Gorski's avatar Filip Gorski Committed by Commit Bot

[EoC] Adding a command line flag to allow a policy bypass

* This only adds a command line for enterprise policy bypass
  (no flag is added in about flags)
* Adds a policy bypass code in the bridge.

Bug: 832797
Change-Id: I9bca2c54dbfff37b52cb56ece5bd3632a5e0ec9c
Reviewed-on: https://chromium-review.googlesource.com/1014467Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarTheresa <twellington@chromium.org>
Commit-Queue: Filip Gorski <fgorski@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551157}
parent aadbc529
......@@ -88,6 +88,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
&kContextualSearchSecondTap,
&kContextualSearchTapDisableOverride,
&kContextualSuggestionsBottomSheet,
&kContextualSuggestionsEnterprisePolicyBypass,
&kCustomContextMenu,
&kCustomFeedbackUi,
&kDontPrefetchLibraries,
......@@ -257,6 +258,10 @@ const base::Feature kContextualSearchTapDisableOverride{
const base::Feature kContextualSuggestionsBottomSheet{
"ContextualSuggestionsBottomSheet", base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kContextualSuggestionsEnterprisePolicyBypass{
"ContextualSuggestionsEnterprisePolicyBypass",
base::FEATURE_DISABLED_BY_DEFAULT};
const base::Feature kCustomContextMenu{"CustomContextMenu",
base::FEATURE_DISABLED_BY_DEFAULT};
......
......@@ -41,6 +41,7 @@ extern const base::Feature kContextualSearchMlTapSuppression;
extern const base::Feature kContextualSearchSecondTap;
extern const base::Feature kContextualSearchTapDisableOverride;
extern const base::Feature kContextualSuggestionsBottomSheet;
extern const base::Feature kContextualSuggestionsEnterprisePolicyBypass;
extern const base::Feature kCustomContextMenu;
extern const base::Feature kCustomFeedbackUi;
extern const base::Feature kDontPrefetchLibraries;
......
......@@ -7,6 +7,7 @@
#include "base/android/callback_android.h"
#include "base/android/jni_string.h"
#include "base/callback.h"
#include "chrome/browser/android/chrome_feature_list.h"
#include "chrome/browser/ntp_snippets/contextual_content_suggestions_service_factory.h"
#include "chrome/browser/policy/profile_policy_connector.h"
#include "chrome/browser/policy/profile_policy_connector_factory.h"
......@@ -53,6 +54,12 @@ static jlong JNI_ContextualSuggestionsBridge_Init(
static jboolean JNI_ContextualSuggestionsBridge_IsEnterprisePolicyManaged(
JNIEnv* env,
const JavaParamRef<jclass>& clazz) {
// Bypass policy check, if corresponding feature is enabled.
if (base::FeatureList::IsEnabled(
chrome::android::kContextualSuggestionsEnterprisePolicyBypass)) {
return false;
}
// TODO(fgorski): This is simply checking whether the profile is managed by
// an enterprise policy.
// http://crbug.com/829460 covers implementation of policy controller for
......
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