diff --git a/app/brave_main_delegate.cc b/app/brave_main_delegate.cc index 2ad419acc9c0..a861ed2957a5 100644 --- a/app/brave_main_delegate.cc +++ b/app/brave_main_delegate.cc @@ -26,6 +26,7 @@ #include "chrome/common/chrome_switches.h" #include "components/autofill/core/common/autofill_features.h" #include "components/autofill/core/common/autofill_payments_features.h" +#include "components/omnibox/common/omnibox_features.h" #include "components/password_manager/core/common/password_manager_features.h" #include "components/unified_consent/feature.h" #include "content/public/common/content_features.h" @@ -139,6 +140,7 @@ bool BraveMainDelegate::BasicStartupComplete(int* exit_code) { extensions_features::kNewExtensionUpdaterService.name, #endif features::kDesktopPWAWindowing.name, + omnibox::kSimplifyHttpsIndicator.name, }; // Disabled features. diff --git a/chromium_src/components/omnibox/browser/location_bar_model_impl.cc b/chromium_src/components/omnibox/browser/location_bar_model_impl.cc new file mode 100644 index 000000000000..88a869a0a7ce --- /dev/null +++ b/chromium_src/components/omnibox/browser/location_bar_model_impl.cc @@ -0,0 +1,22 @@ +/* Copyright (c) 2019 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "components/omnibox/browser/location_bar_model_impl.h" + +#include "components/omnibox/browser/omnibox_field_trial.h" + +#define GetFieldTrialParamValueByFeature \ + GetFieldTrialParamValueByFeature_ChromiumImpl + +namespace base { +std::string GetFieldTrialParamValueByFeature(const base::Feature& feature, + const std::string& param_name) { + return OmniboxFieldTrial::kSimplifyHttpsIndicatorParameterBothToLock; +} +} // namespace base + +#include "../../../../../../../components/omnibox/browser/location_bar_model_impl.cc" // NOLINT + +#undef GetFieldTrialParamValueByFeature diff --git a/chromium_src/components/variations/service/field_trial_unittest.cc b/chromium_src/components/variations/service/field_trial_unittest.cc new file mode 100644 index 000000000000..2e676f2f3b93 --- /dev/null +++ b/chromium_src/components/variations/service/field_trial_unittest.cc @@ -0,0 +1,20 @@ +/* Copyright (c) 2019 The Brave Authors. All rights reserved. + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "components/variations/service/buildflags.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace { +typedef testing::Test FieldTrialsTest; + +TEST_F(FieldTrialsTest, FieldTrialsTestingEnabled) { + bool enabled = false; +#if BUILDFLAG(FIELDTRIAL_TESTING_ENABLED) + enabled = true +#endif // BUILDFLAG(FIELDTRIAL_TESTING_ENABLED) + EXPECT_FALSE(enabled); +} + +} // namespace diff --git a/patches/components-variations-service-BUILD.gn.patch b/patches/components-variations-service-BUILD.gn.patch new file mode 100644 index 000000000000..7389260dc62e --- /dev/null +++ b/patches/components-variations-service-BUILD.gn.patch @@ -0,0 +1,13 @@ +diff --git a/components/variations/service/BUILD.gn b/components/variations/service/BUILD.gn +index bdabd37ad8d0f98aad110d68f8058885d3f3c31a..98864341b6223ca591bcd19dc9097d1b6fb829b0 100644 +--- a/components/variations/service/BUILD.gn ++++ b/components/variations/service/BUILD.gn +@@ -11,7 +11,7 @@ declare_args() { + # Note: this setting is ignored if is_chrome_branded. + # TODO(thakis): It's strange this is called "_like_official_build" but then + # checks is_chrome_branded, not is_official_build. +- fieldtrial_testing_like_official_build = is_chrome_branded ++ fieldtrial_testing_like_official_build = true + } + + fieldtrial_testing_enabled = diff --git a/test/BUILD.gn b/test/BUILD.gn index 89cacaa9202c..bfbd2641a402 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -74,8 +74,9 @@ test("brave_unit_tests") { "//brave/chromium_src/components/metrics/enabled_state_provider_unittest.cc", "//brave/chromium_src/components/search_engines/brave_template_url_prepopulate_data_unittest.cc", "//brave/chromium_src/components/search_engines/brave_template_url_service_util_unittest.cc", - "//brave/chromium_src/components/translate/core/browser/translate_manager_unittest.cc", + "//brave/chromium_src/components/variations/service/field_trial_unittest.cc", "//brave/chromium_src/components/version_info/brave_version_info_unittest.cc", + "//brave/chromium_src/components/translate/core/browser/translate_manager_unittest.cc", "//brave/chromium_src/net/cookies/brave_canonical_cookie_unittest.cc", "//brave/common/brave_content_client_unittest.cc", "//brave/common/importer/brave_mock_importer_bridge.cc",