summaryrefslogtreecommitdiff
path: root/chromium/chrome/browser/profiles/profile.cc
blob: b68749fd01f78605d157dbde9a4b6a50dc0c97ad (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
// 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.

#include "chrome/browser/profiles/profile.h"

#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"

// static
Profile* Profile::FromBrowserContext(content::BrowserContext* browser_context) {
  // This is safe; this is the only implementation of the browser context.
  return static_cast<Profile*>(browser_context);
}

// static
Profile* Profile::FromWebUI(content::WebUI* web_ui) {
  return FromBrowserContext(web_ui->GetWebContents()->GetBrowserContext());
}

Profile* Profile::GetOriginalProfile() {
  return this;
}

const Profile* Profile::GetOriginalProfile() const {
  return this;
}