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

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: works now 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_web_ui.cc
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index 0c91bde02223b042c48e17c3b6c1df6e804ab08c..567ec4ef9ceeed7517d607af88748f91ea9265a6 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -129,7 +129,8 @@ 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 = static_cast<Profile*>(tab_contents->context());
+ ExtensionService* service = profile->GetExtensionService();
const Extension* extension = service->GetExtensionByURL(url);
if (!extension)
extension = service->GetExtensionByWebExtent(url);
@@ -163,7 +164,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 +187,12 @@ void ExtensionWebUI::RegisterUserPrefs(PrefService* prefs) {
}
// static
-bool ExtensionWebUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
+bool ExtensionWebUI::HandleChromeURLOverride(GURL* url,
+ content::BrowserContext* context) {
if (!url->SchemeIs(chrome::kChromeUIScheme))
return false;
+ Profile* profile = static_cast<Profile*>(context);
const DictionaryValue* overrides =
profile->GetPrefs()->GetDictionary(kExtensionURLOverrides);
std::string page = url->host();
@@ -249,8 +252,9 @@ bool ExtensionWebUI::HandleChromeURLOverride(GURL* url, Profile* profile) {
}
// static
-bool ExtensionWebUI::HandleChromeURLOverrideReverse(GURL* url,
- Profile* profile) {
+bool ExtensionWebUI::HandleChromeURLOverrideReverse(
+ GURL* url, content::BrowserContext* context) {
+ Profile* profile = static_cast<Profile*>(context);
const DictionaryValue* overrides =
profile->GetPrefs()->GetDictionary(kExtensionURLOverrides);
if (!overrides)
@@ -334,7 +338,8 @@ 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 = static_cast<Profile*>(tab->context());
+ if (tab_profile != profile)
continue;
GURL url = tab->GetURL();

Powered by Google App Engine
This is Rietveld 408576698