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

Unified Diff: chrome/browser/extensions/extension_process_manager.cc

Issue 7492051: Revert 94332 - Removal of Profile from content part 2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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/extensions/extension_process_manager.cc
===================================================================
--- chrome/browser/extensions/extension_process_manager.cc (revision 94334)
+++ chrome/browser/extensions/extension_process_manager.cc (working copy)
@@ -132,9 +132,8 @@
const GURL& url, Browser* browser, ViewType::Type view_type) {
// A NULL browser may only be given for pop-up views.
DCHECK(browser || (!browser && view_type == ViewType::EXTENSION_POPUP));
- Profile* profile =
- Profile::FromBrowserContext(browsing_instance_->browser_context());
- ExtensionService* service = profile->GetExtensionService();
+ ExtensionService* service =
+ browsing_instance_->profile()->GetExtensionService();
if (service) {
const Extension* extension = service->GetExtensionByURL(url);
if (extension)
@@ -199,9 +198,8 @@
// Force the options page to open in non-OTR window, because it won't be
// able to save settings from OTR.
if (!browser || browser->profile()->IsOffTheRecord()) {
- Profile* profile =
- Profile::FromBrowserContext(browsing_instance_->browser_context());
- browser = Browser::GetOrCreateTabbedBrowser(profile->GetOriginalProfile());
+ browser = Browser::GetOrCreateTabbedBrowser(
+ browsing_instance_->profile()->GetOriginalProfile());
}
browser->OpenURL(extension->options_url(), GURL(), SINGLETON_TAB,
@@ -264,9 +262,8 @@
if (it != extension_ids_.end()) {
// Look up the extension by ID, including disabled extensions in case
// this gets called while an old process is still around.
- Profile* profile =
- Profile::FromBrowserContext(browsing_instance_->browser_context());
- ExtensionService* service = profile->GetExtensionService();
+ ExtensionService* service =
+ browsing_instance_->profile()->GetExtensionService();
return service->GetExtensionById(it->second, false);
}
@@ -345,7 +342,7 @@
void ExtensionProcessManager::OnExtensionHostCreated(ExtensionHost* host,
bool is_background) {
- DCHECK_EQ(browsing_instance_->browser_context(), host->profile());
+ DCHECK_EQ(browsing_instance_->profile(), host->profile());
all_hosts_.insert(host);
if (is_background)
@@ -445,9 +442,8 @@
const Extension* IncognitoExtensionProcessManager::GetExtensionOrAppByURL(
const GURL& url) {
- Profile* profile =
- Profile::FromBrowserContext(browsing_instance_->browser_context());
- ExtensionService* service = profile->GetExtensionService();
+ ExtensionService* service =
+ browsing_instance_->profile()->GetExtensionService();
if (!service)
return NULL;
return (url.SchemeIs(chrome::kExtensionScheme)) ?
@@ -456,9 +452,8 @@
bool IncognitoExtensionProcessManager::IsIncognitoEnabled(
const Extension* extension) {
- Profile* profile =
- Profile::FromBrowserContext(browsing_instance_->browser_context());
- ExtensionService* service = profile->GetExtensionService();
+ ExtensionService* service =
+ browsing_instance_->profile()->GetExtensionService();
return service && service->IsIncognitoEnabled(extension->id());
}
@@ -472,13 +467,12 @@
// incognito window. Watch for new browsers and create the hosts if
// it matches our profile.
Browser* browser = Source<Browser>(source).ptr();
- if (browser->profile() == browsing_instance_->browser_context()) {
+ if (browser->profile() == browsing_instance_->profile()) {
// On Chrome OS, a login screen is implemented as a browser.
// This browser has no extension service. In this case,
// service will be NULL.
- Profile* profile =
- Profile::FromBrowserContext(browsing_instance_->browser_context());
- ExtensionService* service = profile->GetExtensionService();
+ ExtensionService* service =
+ browsing_instance_->profile()->GetExtensionService();
if (service && service->is_ready())
CreateBackgroundHosts(this, service->extensions());
}
« no previous file with comments | « chrome/browser/extensions/extension_message_service.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698