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

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

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 | « no previous file | chrome/browser/ui/alternate_error_tab_observer.cc » ('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.h
diff --git a/chrome/browser/ui/alternate_error_tab_observer.h b/chrome/browser/ui/alternate_error_tab_observer.h
index 9bacdd12468f4e57e4d5fb42e45369f998d941a9..f7ac4bb3c2bc679584bc493e7192c6a0ed7ac66a 100644
--- a/chrome/browser/ui/alternate_error_tab_observer.h
+++ b/chrome/browser/ui/alternate_error_tab_observer.h
@@ -7,6 +7,7 @@
#include "chrome/browser/api/prefs/pref_change_registrar.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/tab_contents/web_contents_user_data.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
@@ -14,16 +15,20 @@
class Profile;
// Per-tab class to implement alternate error page functionality.
-class AlternateErrorPageTabObserver : public content::WebContentsObserver,
- public content::NotificationObserver {
+class AlternateErrorPageTabObserver
+ : public content::WebContentsObserver,
+ public content::NotificationObserver,
+ public WebContentsUserData<AlternateErrorPageTabObserver> {
public:
- AlternateErrorPageTabObserver(content::WebContents* web_contents,
- Profile* profile);
virtual ~AlternateErrorPageTabObserver();
static void RegisterUserPrefs(PrefService* prefs);
private:
+ explicit AlternateErrorPageTabObserver(content::WebContents* web_contents);
+ static int kUserDataKey;
+ friend class WebContentsUserData<AlternateErrorPageTabObserver>;
+
// content::WebContentsObserver overrides:
virtual void RenderViewCreated(
content::RenderViewHost* render_view_host) OVERRIDE;
« no previous file with comments | « no previous file | chrome/browser/ui/alternate_error_tab_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698