Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: chrome/browser/ui/webui/chrome_web_ui_factory.cc

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: slight tweaking for comments Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chrome_web_ui_factory.cc
diff --git a/chrome/browser/ui/webui/chrome_web_ui_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_factory.cc
index a8066b7936c46aaec1e8b7efe93a39b40fb5990f..5af10a84649e8fdeb23f7a9f67bfdac5a481298e 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_factory.cc
@@ -262,15 +262,16 @@ struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> {
} // namespace
-WebUI::TypeID ChromeWebUIFactory::GetWebUIType(Profile* profile,
- const GURL& url) const {
+WebUI::TypeID ChromeWebUIFactory::GetWebUIType(
+ content::BrowserContext* browser_context, const GURL& url) const {
+ Profile* profile = Profile::FromBrowserContext(browser_context);
WebUIFactoryFunction function = GetWebUIFactoryFunction(profile, url);
return function ? reinterpret_cast<WebUI::TypeID>(function) : WebUI::kNoWebUI;
}
-bool ChromeWebUIFactory::UseWebUIForURL(Profile* profile,
- const GURL& url) const {
- return GetWebUIType(profile, url) != WebUI::kNoWebUI;
+bool ChromeWebUIFactory::UseWebUIForURL(
+ content::BrowserContext* browser_context, const GURL& url) const {
+ return GetWebUIType(browser_context, url) != WebUI::kNoWebUI;
}
bool ChromeWebUIFactory::HasWebUIScheme(const GURL& url) const {
@@ -281,9 +282,9 @@ bool ChromeWebUIFactory::HasWebUIScheme(const GURL& url) const {
}
bool ChromeWebUIFactory::IsURLAcceptableForWebUI(
- Profile* profile,
+ content::BrowserContext* browser_context,
const GURL& url) const {
- return UseWebUIForURL(profile, url) ||
+ return UseWebUIForURL(browser_context, url) ||
// javacsript: URLs are allowed to run in Web UI pages
url.SchemeIs(chrome::kJavaScriptScheme) ||
// It's possible to load about:blank in a Web UI renderer.
@@ -299,8 +300,9 @@ bool ChromeWebUIFactory::IsURLAcceptableForWebUI(
WebUI* ChromeWebUIFactory::CreateWebUIForURL(
TabContents* tab_contents,
const GURL& url) const {
- WebUIFactoryFunction function = GetWebUIFactoryFunction(
- tab_contents->profile(), url);
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents->browser_context());
+ WebUIFactoryFunction function = GetWebUIFactoryFunction(profile, url);
if (!function)
return NULL;
return (*function)(tab_contents, url);
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_ui_factory.h ('k') | chrome/browser/ui/webui/test_chrome_web_ui_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698