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{
"SupervisedUserInitiatedExtensionInstall",
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kEduCoexistenceFlowV2{"kEduCoexistenceV2",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace supervised_users
......@@ -13,6 +13,8 @@ extern const base::Feature kSupervisedUserIframeFilter;
extern const base::Feature kSupervisedUserInitiatedExtensionInstall;
extern const base::Feature kEduCoexistenceFlowV2;
} // namespace supervised_users
#endif // CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_FEATURES_H_
......@@ -275,12 +275,13 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserNavigationThrottleTest,
GURL manually_blocked_url = embedded_test_server()->GetURL(
kExampleHost2, "/supervised_user/with_iframes.html");
ui_test_utils::NavigateToURL(browser(),
GURL(chrome::kChromeUIEDUCoexistenceLoginURL));
ui_test_utils::NavigateToURL(
browser(), GURL(SupervisedUserService::GetEduCoexistenceLoginUrl()));
// Get the top level WebContents.
content::WebContents* contents =
browser()->tab_strip_model()->GetActiveWebContents();
EXPECT_EQ(contents->GetURL(), GURL(chrome::kChromeUIEDUCoexistenceLoginURL));
EXPECT_EQ(contents->GetURL(),
GURL(SupervisedUserService::GetEduCoexistenceLoginUrl()));
InnerWebContentsAttachedWaiter web_contents_attached_waiter(
browser()->tab_strip_model()->GetActiveWebContents());
......
......@@ -39,6 +39,7 @@
#include "chrome/browser/supervised_user/supervised_user_site_list.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/policy/core/browser/url_util.h"
#include "components/pref_registry/pref_registry_syncable.h"
......@@ -277,6 +278,13 @@ bool SupervisedUserService::IsSupervisedUserIframeFilterEnabled() const {
supervised_users::kSupervisedUserIframeFilter);
}
// static
std::string SupervisedUserService::GetEduCoexistenceLoginUrl() {
return base::FeatureList::IsEnabled(supervised_users::kEduCoexistenceFlowV2)
? chrome::kChromeUIEDUCoexistenceLoginURLV2
: chrome::kChromeUIEDUCoexistenceLoginURLV1;
}
bool SupervisedUserService::IsChild() const {
return profile_->IsChild();
}
......
......@@ -159,6 +159,8 @@ class SupervisedUserService : public KeyedService,
bool IsSupervisedUserIframeFilterEnabled() const;
static std::string GetEduCoexistenceLoginUrl();
// 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).
bool IsChild() const;
......
......@@ -26,8 +26,11 @@
#include "base/task/thread_pool.h"
#include "base/task_runner_util.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/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/webui_url_constants.h"
#include "components/policy/core/browser/url_util.h"
......@@ -239,7 +242,7 @@ bool SupervisedUserURLFilter::ShouldSkipParentManualAllowlistFiltering(
contents->GetOutermostWebContents();
return outer_most_content->GetURL() ==
GURL(chrome::kChromeUIEDUCoexistenceLoginURL);
GURL(SupervisedUserService::GetEduCoexistenceLoginUrl());
}
// static
......
......@@ -16,6 +16,8 @@
#include "chrome/browser/chromeos/arc/arc_util.h"
#include "chrome/browser/chromeos/profiles/profile_helper.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/common/webui_url_constants.h"
#include "chromeos/constants/chromeos_pref_names.h"
......@@ -86,7 +88,8 @@ GURL GetInlineLoginUrl(const std::string& email,
source == InlineLoginDialogChromeOS::Source::kArc) {
return GURL(chrome::kChromeUIAccountManagerErrorURL);
}
return GetUrlWithEmailParam(chrome::kChromeUIEDUCoexistenceLoginURL, email);
return GetUrlWithEmailParam(
SupervisedUserService::GetEduCoexistenceLoginUrl(), email);
}
} // namespace
......
......@@ -68,7 +68,9 @@ const char kChromeUIDownloadInternalsHost[] = "download-internals";
const char kChromeUIDownloadsHost[] = "downloads";
const char kChromeUIDownloadsURL[] = "chrome://downloads/";
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 kChromeUIExtensionIconURL[] = "chrome://extension-icon/";
const char kChromeUIExtensionsHost[] = "extensions";
......
......@@ -71,7 +71,8 @@ extern const char kChromeUIDownloadInternalsHost[];
extern const char kChromeUIDownloadsHost[];
extern const char kChromeUIDownloadsURL[];
extern const char kChromeUIDriveInternalsHost[];
extern const char kChromeUIEDUCoexistenceLoginURL[];
extern const char kChromeUIEDUCoexistenceLoginURLV1[];
extern const char kChromeUIEDUCoexistenceLoginURLV2[];
extern const char kChromeUIExtensionIconHost[];
extern const char kChromeUIExtensionIconURL[];
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