browser_profile_type.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2019 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 COMPONENTS_PROFILE_METRICS_BROWSER_PROFILE_TYPE_H_
  5. #define COMPONENTS_PROFILE_METRICS_BROWSER_PROFILE_TYPE_H_
  6. #include "base/supports_user_data.h"
  7. namespace profile_metrics {
  8. // These values are persisted to logs. Entries should not be renumbered and
  9. // numeric values should never be reused.
  10. // A Java counterpart will be generated for this enum.
  11. // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.components.profile_metrics
  12. enum class BrowserProfileType {
  13. kRegular = 0,
  14. kIncognito = 1,
  15. kGuest = 2,
  16. kSystem = 3,
  17. kOtherOffTheRecordProfile = 4,
  18. kDeprecatedEphemeralGuest = 5,
  19. kMaxValue = kDeprecatedEphemeralGuest,
  20. };
  21. // Returns the BrowserProfileType value associated with |browser_context|.
  22. // Note that the browser profile type should be set for all BrowserContext (or
  23. // equivalent) objects during creation or initialization of the object. This
  24. // function will result in a crash if |SetBrowserProfileType| is not called
  25. // before to associate the browser profile type.
  26. BrowserProfileType GetBrowserProfileType(
  27. const base::SupportsUserData* browser_context);
  28. // Associates |type| as the BrowserProfileType value for |browser_context|.
  29. void SetBrowserProfileType(base::SupportsUserData* browser_context,
  30. BrowserProfileType type);
  31. } // namespace profile_metrics
  32. #endif // COMPONENTS_PROFILE_METRICS_BROWSER_PROFILE_TYPE_H_