#include "chrome/browser/enterprise/profile_management/profile_management_navigation_throttle.h"
#include <optional>
#include <string>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/containers/flat_map.h"
#include "base/feature_list.h"
#include "base/json/json_reader.h"
#include "base/memory/weak_ptr.h"
#include "base/no_destructor.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/profile_management/profile_management_features.h"
#include "chrome/browser/enterprise/profile_management/saml_response_parser.h"
#include "chrome/browser/enterprise/signin/profile_token_web_signin_interceptor.h"
#include "chrome/browser/enterprise/signin/profile_token_web_signin_interceptor_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/common/chrome_switches.h"
#include "components/account_id/account_id.h"
#include "components/prefs/pref_service.h"
#include "components/signin/public/base/signin_pref_names.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_user_data.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "net/base/url_util.h"
#include "services/data_decoder/public/cpp/data_decoder.h"
#include "url/gurl.h"
namespace profile_management {
namespace …
std::unique_ptr<ProfileManagementNavigationThrottle>
ProfileManagementNavigationThrottle::MaybeCreateThrottleFor(
content::NavigationHandle* navigation_handle) { … }
ProfileManagementNavigationThrottle::ProfileManagementNavigationThrottle(
content::NavigationHandle* navigation_handle)
: … { … }
ProfileManagementNavigationThrottle::~ProfileManagementNavigationThrottle() =
default;
content::NavigationThrottle::ThrottleCheckResult
ProfileManagementNavigationThrottle::WillProcessResponse() { … }
const char* ProfileManagementNavigationThrottle::GetNameForLogging() { … }
void ProfileManagementNavigationThrottle::SetURLsForTesting(
const std::string& token_url,
const std::string& unmanaged_url) { … }
void ProfileManagementNavigationThrottle::ClearAttributeMapForTesting() { … }
void ProfileManagementNavigationThrottle::OnResponseBodyReady(
const std::string& body) { … }
void ProfileManagementNavigationThrottle::OnManagementDataReceived(
const base::flat_map<std::string, std::string>& attributes) { … }
void ProfileManagementNavigationThrottle::PostNavigateTo(const GURL& url) { … }
void ProfileManagementNavigationThrottle::NavigateTo(const GURL& url) { … }
void ProfileManagementNavigationThrottle::RegisterWithDomain(
const std::string& domain) { … }
void ProfileManagementNavigationThrottle::RegisterWithToken(
const std::string& name,
const std::string& token) { … }
}