Commit 8f1b296a authored by Danan S's avatar Danan S Committed by Commit Bot

Add flag (disabled by default) to switch to EDU Coexistence V2

Bug: 1128446
Change-Id: I6f6616186fd2cb4bf5e6e7a5c422b3b2f052967b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2411653
Commit-Queue: Dan S <danan@chromium.org>
Reviewed-by: default avatarYilkal Abe <yilkal@chromium.org>
Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#807601}
parent a35e7b9f
...@@ -13,4 +13,6 @@ const base::Feature kSupervisedUserInitiatedExtensionInstall{ ...@@ -13,4 +13,6 @@ const base::Feature kSupervisedUserInitiatedExtensionInstall{
"SupervisedUserInitiatedExtensionInstall", "SupervisedUserInitiatedExtensionInstall",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kEduCoexistenceFlowV2{"kEduCoexistenceV2",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace supervised_users } // namespace supervised_users
...@@ -13,6 +13,8 @@ extern const base::Feature kSupervisedUserIframeFilter; ...@@ -13,6 +13,8 @@ extern const base::Feature kSupervisedUserIframeFilter;
extern const base::Feature kSupervisedUserInitiatedExtensionInstall; extern const base::Feature kSupervisedUserInitiatedExtensionInstall;
extern const base::Feature kEduCoexistenceFlowV2;
} // namespace supervised_users } // namespace supervised_users
#endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_FEATURES_H_ #endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_FEATURES_H_
...@@ -275,12 +275,13 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserNavigationThrottleTest, ...@@ -275,12 +275,13 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserNavigationThrottleTest,
GURL manually_blocked_url = embedded_test_server()->GetURL( GURL manually_blocked_url = embedded_test_server()->GetURL(
kExampleHost2, "/supervised_user/with_iframes.html"); kExampleHost2, "/supervised_user/with_iframes.html");
ui_test_utils::NavigateToURL(browser(), ui_test_utils::NavigateToURL(
GURL(chrome::kChromeUIEDUCoexistenceLoginURL)); browser(), GURL(SupervisedUserService::GetEduCoexistenceLoginUrl()));
// Get the top level WebContents. // Get the top level WebContents.
content::WebContents* contents = content::WebContents* contents =
browser()->tab_strip_model()->GetActiveWebContents(); browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(contents->GetURL(), GURL(chrome::kChromeUIEDUCoexistenceLoginURL)); EXPECT_EQ(contents->GetURL(),
GURL(SupervisedUserService::GetEduCoexistenceLoginUrl()));
InnerWebContentsAttachedWaiter web_contents_attached_waiter( InnerWebContentsAttachedWaiter web_contents_attached_waiter(
browser()->tab_strip_model()->GetActiveWebContents()); browser()->tab_strip_model()->GetActiveWebContents());
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "chrome/browser/supervised_user/supervised_user_site_list.h" #include "chrome/browser/supervised_user/supervised_user_site_list.h"
#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/policy/core/browser/url_util.h" #include "components/policy/core/browser/url_util.h"
#include "components/pref_registry/pref_registry_syncable.h" #include "components/pref_registry/pref_registry_syncable.h"
...@@ -277,6 +278,13 @@ bool SupervisedUserService::IsSupervisedUserIframeFilterEnabled() const { ...@@ -277,6 +278,13 @@ bool SupervisedUserService::IsSupervisedUserIframeFilterEnabled() const {
supervised_users::kSupervisedUserIframeFilter); supervised_users::kSupervisedUserIframeFilter);
} }
// static
std::string SupervisedUserService::GetEduCoexistenceLoginUrl() {
return base::FeatureList::IsEnabled(supervised_users::kEduCoexistenceFlowV2)
? chrome::kChromeUIEDUCoexistenceLoginURLV2
: chrome::kChromeUIEDUCoexistenceLoginURLV1;
}
bool SupervisedUserService::IsChild() const { bool SupervisedUserService::IsChild() const {
return profile_->IsChild(); return profile_->IsChild();
} }
......
...@@ -159,6 +159,8 @@ class SupervisedUserService : public KeyedService, ...@@ -159,6 +159,8 @@ class SupervisedUserService : public KeyedService,
bool IsSupervisedUserIframeFilterEnabled() const; bool IsSupervisedUserIframeFilterEnabled() const;
static std::string GetEduCoexistenceLoginUrl();
// Returns true if the user is a type of Family Link Child account, // Returns true if the user is a type of Family Link Child account,
// but will not return true for a Legacy Supervised user (or non child users). // but will not return true for a Legacy Supervised user (or non child users).
bool IsChild() const; bool IsChild() const;
......
...@@ -26,8 +26,11 @@ ...@@ -26,8 +26,11 @@
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
#include "base/task_runner_util.h" #include "base/task_runner_util.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/supervised_user/kids_management_url_checker_client.h" #include "chrome/browser/supervised_user/kids_management_url_checker_client.h"
#include "chrome/browser/supervised_user/supervised_user_denylist.h" #include "chrome/browser/supervised_user/supervised_user_denylist.h"
#include "chrome/browser/supervised_user/supervised_user_service.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
#include "chrome/common/webui_url_constants.h" #include "chrome/common/webui_url_constants.h"
#include "components/policy/core/browser/url_util.h" #include "components/policy/core/browser/url_util.h"
...@@ -239,7 +242,7 @@ bool SupervisedUserURLFilter::ShouldSkipParentManualAllowlistFiltering( ...@@ -239,7 +242,7 @@ bool SupervisedUserURLFilter::ShouldSkipParentManualAllowlistFiltering(
contents->GetOutermostWebContents(); contents->GetOutermostWebContents();
return outer_most_content->GetURL() == return outer_most_content->GetURL() ==
GURL(chrome::kChromeUIEDUCoexistenceLoginURL); GURL(SupervisedUserService::GetEduCoexistenceLoginUrl());
} }
// static // static
......
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
#include "chrome/browser/chromeos/arc/arc_util.h" #include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/supervised_user/supervised_user_service.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#include "chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h" #include "chrome/browser/ui/webui/chromeos/system_web_dialog_delegate.h"
#include "chrome/common/webui_url_constants.h" #include "chrome/common/webui_url_constants.h"
#include "chromeos/constants/chromeos_pref_names.h" #include "chromeos/constants/chromeos_pref_names.h"
...@@ -86,7 +88,8 @@ GURL GetInlineLoginUrl(const std::string& email, ...@@ -86,7 +88,8 @@ GURL GetInlineLoginUrl(const std::string& email,
source == InlineLoginDialogChromeOS::Source::kArc) { source == InlineLoginDialogChromeOS::Source::kArc) {
return GURL(chrome::kChromeUIAccountManagerErrorURL); return GURL(chrome::kChromeUIAccountManagerErrorURL);
} }
return GetUrlWithEmailParam(chrome::kChromeUIEDUCoexistenceLoginURL, email); return GetUrlWithEmailParam(
SupervisedUserService::GetEduCoexistenceLoginUrl(), email);
} }
} // namespace } // namespace
......
...@@ -68,7 +68,9 @@ const char kChromeUIDownloadInternalsHost[] = "download-internals"; ...@@ -68,7 +68,9 @@ const char kChromeUIDownloadInternalsHost[] = "download-internals";
const char kChromeUIDownloadsHost[] = "downloads"; const char kChromeUIDownloadsHost[] = "downloads";
const char kChromeUIDownloadsURL[] = "chrome://downloads/"; const char kChromeUIDownloadsURL[] = "chrome://downloads/";
const char kChromeUIDriveInternalsHost[] = "drive-internals"; const char kChromeUIDriveInternalsHost[] = "drive-internals";
const char kChromeUIEDUCoexistenceLoginURL[] = "chrome://chrome-signin/edu"; const char kChromeUIEDUCoexistenceLoginURLV1[] = "chrome://chrome-signin/edu";
const char kChromeUIEDUCoexistenceLoginURLV2[] =
"chrome://chrome-signin/edu-coexistence";
const char kChromeUIExtensionIconHost[] = "extension-icon"; const char kChromeUIExtensionIconHost[] = "extension-icon";
const char kChromeUIExtensionIconURL[] = "chrome://extension-icon/"; const char kChromeUIExtensionIconURL[] = "chrome://extension-icon/";
const char kChromeUIExtensionsHost[] = "extensions"; const char kChromeUIExtensionsHost[] = "extensions";
......
...@@ -71,7 +71,8 @@ extern const char kChromeUIDownloadInternalsHost[]; ...@@ -71,7 +71,8 @@ extern const char kChromeUIDownloadInternalsHost[];
extern const char kChromeUIDownloadsHost[]; extern const char kChromeUIDownloadsHost[];
extern const char kChromeUIDownloadsURL[]; extern const char kChromeUIDownloadsURL[];
extern const char kChromeUIDriveInternalsHost[]; extern const char kChromeUIDriveInternalsHost[];
extern const char kChromeUIEDUCoexistenceLoginURL[]; extern const char kChromeUIEDUCoexistenceLoginURLV1[];
extern const char kChromeUIEDUCoexistenceLoginURLV2[];
extern const char kChromeUIExtensionIconHost[]; extern const char kChromeUIExtensionIconHost[];
extern const char kChromeUIExtensionIconURL[]; extern const char kChromeUIExtensionIconURL[];
extern const char kChromeUIExtensionsHost[]; extern const char kChromeUIExtensionsHost[];
......
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