blob: 46d5f28cbd824b8fb3abf8dfb5b468423efbfeb2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This a QtWebEngine specific stripped down replacement of Chromiums's Profile
// class, because it is used many places just for preference access.
#ifndef CHROME_BROWSER_PROFILES_PROFILE_H_
#define CHROME_BROWSER_PROFILES_PROFILE_H_
#include "content/public/browser/browser_context.h"
class PrefService;
namespace content {
class WebUI;
}
class Profile : public content::BrowserContext {
public:
// Returns the profile corresponding to the given browser context.
static Profile* FromBrowserContext(content::BrowserContext* browser_context);
// Returns the profile corresponding to the given WebUI.
static Profile* FromWebUI(content::WebUI* web_ui);
// Retrieves a pointer to the PrefService that manages the
// preferences for this user profile.
virtual PrefService* GetPrefs() = 0;
virtual const PrefService* GetPrefs() const = 0;
Profile *GetOriginalProfile();
const Profile *GetOriginalProfile() const;
// Returns whether the profile is new. A profile is new if the browser has
// not been shut down since the profile was created.
virtual bool IsNewProfile() const = 0;
// Returns whether it's a regular profile.
bool IsRegularProfile() const;
// Returns whether it is an Incognito profile. An Incognito profile is an
// off-the-record profile that is used for incognito mode.
bool IsIncognitoProfile() const;
// Returns whether it is a system profile.
bool IsSystemProfile() const;
// Returns whether it is a Guest session. This covers both regular and
// off-the-record profiles of a Guest session.
virtual bool IsGuestSession() const;
};
#endif // CHROME_BROWSER_PROFILES_PROFILE_H_
|