1 // Copyright 2013 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 
5 #include "chrome/browser/profiles/incognito_helpers.h"
6 
7 #include "chrome/browser/profiles/profile.h"
8 
9 namespace chrome {
10 
GetBrowserContextRedirectedInIncognito(content::BrowserContext * context)11 content::BrowserContext* GetBrowserContextRedirectedInIncognito(
12     content::BrowserContext* context) {
13   return Profile::FromBrowserContext(context)->GetOriginalProfile();
14 }
15 
GetBrowserContextRedirectedInIncognito(const content::BrowserContext * context)16 const content::BrowserContext* GetBrowserContextRedirectedInIncognito(
17     const content::BrowserContext* context) {
18   const Profile* profile = Profile::FromBrowserContext(
19       const_cast<content::BrowserContext*>(context));
20   return profile->GetOriginalProfile();
21 }
22 
GetBrowserContextOwnInstanceInIncognito(content::BrowserContext * context)23 content::BrowserContext* GetBrowserContextOwnInstanceInIncognito(
24     content::BrowserContext* context) {
25   return context;
26 }
27 
28 }  // namespace chrome
29