Chromium Code Reviews| Index: chrome/browser/captive_portal/captive_portal_tab_helper.h |
| diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper.h b/chrome/browser/captive_portal/captive_portal_tab_helper.h |
| index ac117b08377797131a679d42b68a9e4cc1383ff0..316f110882dd029b2861f45036dec364013a7151 100644 |
| --- a/chrome/browser/captive_portal/captive_portal_tab_helper.h |
| +++ b/chrome/browser/captive_portal/captive_portal_tab_helper.h |
| @@ -10,6 +10,7 @@ |
| #include "base/memory/scoped_ptr.h" |
| #include "base/threading/non_thread_safe.h" |
| #include "chrome/browser/captive_portal/captive_portal_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" |
| @@ -51,12 +52,12 @@ class CaptivePortalTabReloader; |
| // |
| // For the design doc, see: |
| // https://docs.google.com/document/d/1k-gP2sswzYNvryu9NcgN7q5XrsMlUdlUdoW9WRaEmfM/edit |
| -class CaptivePortalTabHelper : public content::WebContentsObserver, |
| - public content::NotificationObserver, |
| - public base::NonThreadSafe { |
| +class CaptivePortalTabHelper |
| + : public content::WebContentsObserver, |
| + public content::NotificationObserver, |
| + public base::NonThreadSafe, |
| + public WebContentsUserData<CaptivePortalTabHelper> { |
| public: |
| - CaptivePortalTabHelper(Profile* profile, |
| - content::WebContents* web_contents); |
| virtual ~CaptivePortalTabHelper(); |
| // content::WebContentsObserver: |
| @@ -99,6 +100,10 @@ class CaptivePortalTabHelper : public content::WebContentsObserver, |
| bool IsLoginTab() const; |
| private: |
| + explicit CaptivePortalTabHelper(content::WebContents* web_contents); |
| + static int kUserDataKey; |
|
mmenke
2012/09/19 16:11:30
Per Google style, non-constant static member decla
Avi (use Gerrit)
2012/09/19 16:41:27
It is constant. It just can't be marked as such, s
mmenke
2012/09/19 16:52:21
Ok, but that's just weird. :(
|
| + friend class WebContentsUserData<CaptivePortalTabHelper>; |
| + |
| friend class CaptivePortalBrowserTest; |
| friend class CaptivePortalTabHelperTest; |
| @@ -128,12 +133,12 @@ class CaptivePortalTabHelper : public content::WebContentsObserver, |
| // Opens a login tab if the profile's active window doesn't have one already. |
| void OpenLoginTab(); |
| + Profile* profile_; |
| + |
| // Neither of these will ever be NULL. |
| scoped_ptr<CaptivePortalTabReloader> tab_reloader_; |
| scoped_ptr<CaptivePortalLoginDetector> login_detector_; |
| - Profile* profile_; |
| - |
| // If a provisional load has failed, and the tab is loading an error page, the |
| // error code associated with the error page we're loading. |
| // net::OK, otherwise. |