blob: 0dbf66caaed759fab38b5f45d02950b040508e5a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// 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"
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());
}
|