browser_params_proxy.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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 CHROMEOS_STARTUP_BROWSER_PARAMS_PROXY_H_
  5. #define CHROMEOS_STARTUP_BROWSER_PARAMS_PROXY_H_
  6. #include "base/no_destructor.h"
  7. #include "chromeos/crosapi/mojom/crosapi.mojom.h"
  8. namespace chromeos {
  9. // Provides access to the browser's initialization parameters,
  10. // dispatching to either BrowserInitParams or BrowserPostLoginParams.
  11. class COMPONENT_EXPORT(CHROMEOS_STARTUP) BrowserParamsProxy {
  12. public:
  13. static BrowserParamsProxy* Get();
  14. // Init and post-login parameters' accessors are listed starting from here.
  15. bool DisableCrosapiForTesting() const;
  16. uint32_t CrosapiVersion() const;
  17. bool DeprecatedAshMetricsEnabledHasValue() const;
  18. bool AshMetricsEnabled() const;
  19. crosapi::mojom::SessionType SessionType() const;
  20. crosapi::mojom::DeviceMode DeviceMode() const;
  21. const absl::optional<base::flat_map<base::Token, uint32_t>>&
  22. InterfaceVersions() const;
  23. const crosapi::mojom::DefaultPathsPtr& DefaultPaths() const;
  24. const absl::optional<std::string>& DeviceAccountGaiaId() const;
  25. crosapi::mojom::MetricsReportingManaged AshMetricsManaged() const;
  26. crosapi::mojom::ExoImeSupport ExoImeSupport() const;
  27. const absl::optional<std::string>& CrosUserIdHash() const;
  28. const absl::optional<std::vector<uint8_t>>& DeviceAccountPolicy() const;
  29. uint64_t LastPolicyFetchAttemptTimestamp() const;
  30. const crosapi::mojom::IdleInfoPtr& IdleInfo() const;
  31. crosapi::mojom::InitialBrowserAction InitialBrowserAction() const;
  32. const crosapi::mojom::AccountPtr& DeviceAccount() const;
  33. bool WebAppsEnabled() const;
  34. bool StandaloneBrowserIsPrimary() const;
  35. const crosapi::mojom::NativeThemeInfoPtr& NativeThemeInfo() const;
  36. const crosapi::mojom::DevicePropertiesPtr& DeviceProperties() const;
  37. crosapi::mojom::OndeviceHandwritingSupport OndeviceHandwritingSupport() const;
  38. const absl::optional<std::vector<crosapi::mojom::BuildFlag>>& BuildFlags()
  39. const;
  40. crosapi::mojom::OpenUrlFrom StartupUrlsFrom() const;
  41. const absl::optional<std::vector<GURL>>& StartupUrls() const;
  42. const crosapi::mojom::DeviceSettingsPtr& DeviceSettings() const;
  43. const absl::optional<std::string>& MetricsServiceClientId() const;
  44. uint64_t UkmClientId() const;
  45. bool StandaloneBrowserIsOnlyBrowser() const;
  46. bool PublishChromeApps() const;
  47. bool PublishHostedApps() const;
  48. crosapi::mojom::BrowserInitParams::InitialKeepAlive InitialKeepAlive() const;
  49. bool IsUnfilteredBluetoothDeviceEnabled() const;
  50. const absl::optional<std::vector<std::string>>& AshCapabilities() const;
  51. const absl::optional<std::vector<GURL>>& AcceptedInternalAshUrls() const;
  52. bool IsHoldingSpaceIncognitoProfileIntegrationEnabled() const;
  53. bool IsHoldingSpaceInProgressDownloadsNotificationSuppressionEnabled() const;
  54. bool IsDeviceEnterprisedManaged() const;
  55. crosapi::mojom::BrowserInitParams::DeviceType DeviceType() const;
  56. bool IsOndeviceSpeechSupported() const;
  57. const absl::optional<base::flat_map<policy::PolicyNamespace, base::Value>>&
  58. DeviceAccountComponentPolicy() const;
  59. const absl::optional<std::string>& AshChromeVersion() const;
  60. bool UseCupsForPrinting() const;
  61. bool UseFlossBluetooth() const;
  62. bool IsCurrentUserDeviceOwner() const;
  63. bool DoNotMuxExtensionAppIds() const;
  64. bool EnableLacrosTtsSupport() const;
  65. crosapi::mojom::BrowserInitParams::LacrosSelection LacrosSelection() const;
  66. bool IsFloatWindowEnabled() const;
  67. bool IsCloudGamingDevice() const;
  68. private:
  69. friend base::NoDestructor<BrowserParamsProxy>;
  70. BrowserParamsProxy() = default;
  71. ~BrowserParamsProxy();
  72. };
  73. } // namespace chromeos
  74. #endif // CHROMEOS_STARTUP_BROWSER_PARAMS_PROXY_H_