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

Unified Diff: chrome/browser/extensions/extension_web_ui.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
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.h ('k') | chrome/browser/external_tab_container_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_web_ui.cc
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index 0c91bde02223b042c48e17c3b6c1df6e804ab08c..dd401924c0895d1fe5a3ca6792238ed60f6f16f2 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -129,7 +129,9 @@ const char ExtensionWebUI::kExtensionURLOverrides[] =
ExtensionWebUI::ExtensionWebUI(TabContents* tab_contents, const GURL& url)
: ChromeWebUI(tab_contents),
url_(url) {
- ExtensionService* service = tab_contents->profile()->GetExtensionService();
+ Profile* profile =
+ Profile::FromBrowserContext(tab_contents->browser_context());
+ ExtensionService* service = profile->GetExtensionService();
const Extension* extension = service->GetExtensionByURL(url);
if (!extension)
extension = service->GetExtensionByWebExtent(url);
@@ -163,7 +165,7 @@ ExtensionWebUI::ExtensionWebUI(TabContents* tab_contents, const GURL& url)
TabContentsWrapper::GetCurrentWrapperForContents(tab_contents_);
DCHECK(tab);
extension_bookmark_manager_event_router_.reset(
- new ExtensionBookmarkManagerEventRouter(GetProfile(), tab));
+ new ExtensionBookmarkManagerEventRouter(profile, tab));
link_transition_type_ = PageTransition::AUTO_BOOKMARK;
}
@@ -186,10 +188,12 @@ void ExtensionWebUI::RegisterUserPrefs(PrefService* prefs) {
}
// static
-bool ExtensionWebUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
+bool ExtensionWebUI::HandleChromeURLOverride(
+ GURL* url, content::BrowserContext* browser_context) {
if (!url->SchemeIs(chrome::kChromeUIScheme))
return false;
+ Profile* profile = Profile::FromBrowserContext(browser_context);
const DictionaryValue* overrides =
profile->GetPrefs()->GetDictionary(kExtensionURLOverrides);
std::string page = url->host();
@@ -249,8 +253,9 @@ bool ExtensionWebUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
}
// static
-bool ExtensionWebUI::HandleChromeURLOverrideReverse(GURL* url,
- Profile* profile) {
+bool ExtensionWebUI::HandleChromeURLOverrideReverse(
+ GURL* url, content::BrowserContext* browser_context) {
+ Profile* profile = Profile::FromBrowserContext(browser_context);
const DictionaryValue* overrides =
profile->GetPrefs()->GetDictionary(kExtensionURLOverrides);
if (!overrides)
@@ -334,7 +339,9 @@ void ExtensionWebUI::UnregisterAndReplaceOverride(const std::string& page,
// tabs for this override and get them to reload the original URL.
for (TabContentsIterator iterator; !iterator.done(); ++iterator) {
TabContents* tab = (*iterator)->tab_contents();
- if (tab->profile() != profile)
+ Profile* tab_profile =
+ Profile::FromBrowserContext(tab->browser_context());
+ if (tab_profile != profile)
continue;
GURL url = tab->GetURL();
« no previous file with comments | « chrome/browser/extensions/extension_web_ui.h ('k') | chrome/browser/external_tab_container_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698