chromium/chrome/browser/profiles/profile.h

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// This class gathers state related to a single user profile.

#ifndef CHROME_BROWSER_PROFILES_PROFILE_H_
#define CHROME_BROWSER_PROFILES_PROFILE_H_

#include <memory>
#include <optional>
#include <string>
#include <vector>

#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "content/public/browser/browser_context.h"

#if BUILDFLAG(IS_ANDROID)
#include "base/android/scoped_java_ref.h"
#endif

class ChromeZoomLevelPrefs;
class ExtensionSpecialStoragePolicy;
class GURL;
class PrefService;
class PrefStore;
class ProfileDestroyer;
class ProfileKey;
class TestingProfile;
class ThemeService;
class InstantService;

namespace base {
class FilePath;
class SequencedTaskRunner;
class Time;
}

namespace content {
class WebUI;
}

namespace policy {
class SchemaRegistryService;
class ProfilePolicyConnector;
class ProfileCloudPolicyManager;
class UserCloudPolicyManager;
class CloudPolicyManager;

#if BUILDFLAG(IS_CHROMEOS_ASH)
class UserCloudPolicyManagerAsh;
#endif
}  // namespace policy

namespace network {
class SharedURLLoaderFactory;
}

namespace user_prefs {
class PrefRegistrySyncable;
}

class ProfileObserver;

// Instead of adding more members to Profile, consider creating a
// KeyedService. See
// http://dev.chromium.org/developers/design-documents/profile-architecture
class Profile : public content::BrowserContext {};

// The comparator for profile pointers as key in a map.
struct ProfileCompare {};

std::ostream& operator<<(std::ostream& out,
                         const Profile::OTRProfileID& profile_id);

#if BUILDFLAG(IS_ANDROID)
namespace jni_zero {
template <>
inline Profile* FromJniType<Profile*>(JNIEnv* env,
                                      const JavaRef<jobject>& j_profile) {
  return Profile::FromJavaObject(j_profile);
}

template <>
inline ScopedJavaLocalRef<jobject> ToJniType<Profile>(JNIEnv* env,
                                                      const Profile& profile) {
  return profile.GetJavaObject();
}
}  // namespace jni_zero
#endif  // BUILDFLAG(IS_ANDROID)
#endif  // CHROME_BROWSER_PROFILES_PROFILE_H_