diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-05-04 11:03:41 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-05-11 13:53:16 +0000 |
commit | 9729c4479fe23554eae6e6dd1f30ff488f470c84 (patch) | |
tree | e72e659f304518ffb630835747cb9797d43f77b0 /chromium/chrome/browser/profiles | |
parent | c1eb7fe66e0e7a6e787f9127d99d293f71fbecb8 (diff) | |
download | qtwebengine-chromium-9729c4479fe23554eae6e6dd1f30ff488f470c84.tar.gz |
Add sources for push-notifications
Change-Id: Ibfaa78cdc3790b5936b2ae683328274ffc89c3bc
Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu>
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'chromium/chrome/browser/profiles')
-rw-r--r-- | chromium/chrome/browser/profiles/incognito_helpers.cc | 28 | ||||
-rw-r--r-- | chromium/chrome/browser/profiles/incognito_helpers.h | 29 |
2 files changed, 57 insertions, 0 deletions
diff --git a/chromium/chrome/browser/profiles/incognito_helpers.cc b/chromium/chrome/browser/profiles/incognito_helpers.cc new file mode 100644 index 00000000000..a319237928b --- /dev/null +++ b/chromium/chrome/browser/profiles/incognito_helpers.cc @@ -0,0 +1,28 @@ +// Copyright 2013 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. + +#include "chrome/browser/profiles/incognito_helpers.h" + +#include "chrome/browser/profiles/profile.h" + +namespace chrome { + +content::BrowserContext* GetBrowserContextRedirectedInIncognito( + content::BrowserContext* context) { + return Profile::FromBrowserContext(context)->GetOriginalProfile(); +} + +const content::BrowserContext* GetBrowserContextRedirectedInIncognito( + const content::BrowserContext* context) { + const Profile* profile = Profile::FromBrowserContext( + const_cast<content::BrowserContext*>(context)); + return profile->GetOriginalProfile(); +} + +content::BrowserContext* GetBrowserContextOwnInstanceInIncognito( + content::BrowserContext* context) { + return context; +} + +} // namespace chrome diff --git a/chromium/chrome/browser/profiles/incognito_helpers.h b/chromium/chrome/browser/profiles/incognito_helpers.h new file mode 100644 index 00000000000..e8e76ce5b95 --- /dev/null +++ b/chromium/chrome/browser/profiles/incognito_helpers.h @@ -0,0 +1,29 @@ +// Copyright 2013 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. + +#ifndef CHROME_BROWSER_PROFILES_INCOGNITO_HELPERS_H_ +#define CHROME_BROWSER_PROFILES_INCOGNITO_HELPERS_H_ + +namespace content { +class BrowserContext; +} + +namespace chrome { + +// Returns the original browser context even for Incognito contexts. +content::BrowserContext* GetBrowserContextRedirectedInIncognito( + content::BrowserContext* context); + +// Returns the original browser context even for Incognito contexts. +const content::BrowserContext* GetBrowserContextRedirectedInIncognito( + const content::BrowserContext* context); + +// Returns non-NULL even for Incognito contexts so that a separate +// instance of a service is created for the Incognito context. +content::BrowserContext* GetBrowserContextOwnInstanceInIncognito( + content::BrowserContext* context); + +} // namespace chrome + +#endif // CHROME_BROWSER_PROFILES_INCOGNITO_HELPERS_H_ |