aw_enterprise_authentication_app_link_manager.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2022 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef ANDROID_WEBVIEW_BROWSER_AW_ENTERPRISE_AUTHENTICATION_APP_LINK_MANAGER_H_
  5. #define ANDROID_WEBVIEW_BROWSER_AW_ENTERPRISE_AUTHENTICATION_APP_LINK_MANAGER_H_
  6. #include <memory>
  7. #include "base/memory/raw_ptr.h"
  8. #include "components/prefs/pref_change_registrar.h"
  9. #include "components/prefs/pref_service.h"
  10. #include "components/url_matcher/url_matcher.h"
  11. #include "url/gurl.h"
  12. namespace android_webview {
  13. class EnterpriseAuthenticationAppLinkManager {
  14. public:
  15. explicit EnterpriseAuthenticationAppLinkManager(PrefService* pref_service);
  16. EnterpriseAuthenticationAppLinkManager(
  17. const EnterpriseAuthenticationAppLinkManager&) = delete;
  18. EnterpriseAuthenticationAppLinkManager& operator=(
  19. const EnterpriseAuthenticationAppLinkManager&) = delete;
  20. ~EnterpriseAuthenticationAppLinkManager();
  21. bool IsEnterpriseAuthenticationUrl(const GURL& url);
  22. private:
  23. // Called when the policy value changes in Prefs.
  24. void OnPolicyUpdated();
  25. PrefChangeRegistrar pref_observer_;
  26. std::unique_ptr<url_matcher::URLMatcher> url_matcher_;
  27. raw_ptr<PrefService> pref_service_;
  28. };
  29. } // namespace android_webview
  30. #endif // ANDROID_WEBVIEW_BROWSER_AW_ENTERPRISE_AUTHENTICATION_APP_LINK_MANAGER_H_