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

Unified Diff: chrome/browser/ui/alternate_error_tab_observer.cc

Issue 10907268: Switch AlternateErrorPageTabObserver to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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/ui/alternate_error_tab_observer.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/alternate_error_tab_observer.cc
diff --git a/chrome/browser/ui/alternate_error_tab_observer.cc b/chrome/browser/ui/alternate_error_tab_observer.cc
index 0ad35012fa8703f1e5462cad1a8e88cdcb49477b..56ce220b3f6162568d79f4023b6078f587ae35cc 100644
--- a/chrome/browser/ui/alternate_error_tab_observer.cc
+++ b/chrome/browser/ui/alternate_error_tab_observer.cc
@@ -16,11 +16,12 @@
using content::RenderViewHost;
using content::WebContents;
+int AlternateErrorPageTabObserver::kUserDataKey;
+
AlternateErrorPageTabObserver::AlternateErrorPageTabObserver(
- WebContents* web_contents,
- Profile* profile)
+ WebContents* web_contents)
: content::WebContentsObserver(web_contents),
- profile_(profile) {
+ profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())) {
PrefService* prefs = profile_->GetPrefs();
if (prefs) {
pref_change_registrar_.Init(prefs);
@@ -51,9 +52,10 @@ void AlternateErrorPageTabObserver::RenderViewCreated(
////////////////////////////////////////////////////////////////////////////////
// content::NotificationObserver overrides
-void AlternateErrorPageTabObserver::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
+void AlternateErrorPageTabObserver::Observe(
+ int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) {
if (type == chrome::NOTIFICATION_PREF_CHANGED) {
DCHECK_EQ(profile_->GetPrefs(), content::Source<PrefService>(source).ptr());
DCHECK_EQ(std::string(prefs::kAlternateErrorPagesEnabled),
« no previous file with comments | « chrome/browser/ui/alternate_error_tab_observer.h ('k') | chrome/browser/ui/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698