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

Side by Side Diff: chrome/browser/captive_portal/captive_portal_tab_helper.cc

Issue 10993064: Make using WebContentsUserData simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" 5 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/captive_portal/captive_portal_login_detector.h" 8 #include "chrome/browser/captive_portal/captive_portal_login_detector.h"
9 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h" 9 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h"
10 #include "chrome/browser/captive_portal/captive_portal_service_factory.h" 10 #include "chrome/browser/captive_portal/captive_portal_service_factory.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/browser.h" 12 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/browser_finder.h" 13 #include "chrome/browser/ui/browser_finder.h"
14 #include "chrome/browser/ui/browser_tabstrip.h" 14 #include "chrome/browser/ui/browser_tabstrip.h"
15 #include "chrome/browser/ui/tab_contents/tab_contents.h" 15 #include "chrome/browser/ui/tab_contents/tab_contents.h"
16 #include "chrome/common/chrome_notification_types.h" 16 #include "chrome/common/chrome_notification_types.h"
17 #include "content/public/browser/notification_details.h" 17 #include "content/public/browser/notification_details.h"
18 #include "content/public/browser/notification_service.h" 18 #include "content/public/browser/notification_service.h"
19 #include "content/public/browser/notification_source.h" 19 #include "content/public/browser/notification_source.h"
20 #include "content/public/browser/notification_types.h" 20 #include "content/public/browser/notification_types.h"
21 #include "content/public/browser/render_process_host.h" 21 #include "content/public/browser/render_process_host.h"
22 #include "content/public/browser/render_view_host.h" 22 #include "content/public/browser/render_view_host.h"
23 #include "content/public/browser/resource_request_details.h" 23 #include "content/public/browser/resource_request_details.h"
24 #include "content/public/browser/web_contents.h" 24 #include "content/public/browser/web_contents.h"
25 #include "net/base/net_errors.h" 25 #include "net/base/net_errors.h"
26 #include "net/base/ssl_info.h" 26 #include "net/base/ssl_info.h"
27 27
28 DEFINE_WEB_CONTENTS_USER_DATA_KEY(captive_portal::CaptivePortalTabHelper)
29
28 namespace captive_portal { 30 namespace captive_portal {
29 31
30 int CaptivePortalTabHelper::kUserDataKey;
31
32 CaptivePortalTabHelper::CaptivePortalTabHelper( 32 CaptivePortalTabHelper::CaptivePortalTabHelper(
33 content::WebContents* web_contents) 33 content::WebContents* web_contents)
34 : content::WebContentsObserver(web_contents), 34 : content::WebContentsObserver(web_contents),
35 // web_contents is NULL in unit tests. 35 // web_contents is NULL in unit tests.
36 profile_(web_contents ? Profile::FromBrowserContext( 36 profile_(web_contents ? Profile::FromBrowserContext(
37 web_contents->GetBrowserContext()) 37 web_contents->GetBrowserContext())
38 : NULL), 38 : NULL),
39 tab_reloader_( 39 tab_reloader_(
40 new CaptivePortalTabReloader( 40 new CaptivePortalTabReloader(
41 profile_, 41 profile_,
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 browser, 261 browser,
262 CaptivePortalServiceFactory::GetForProfile(profile_)->test_url(), 262 CaptivePortalServiceFactory::GetForProfile(profile_)->test_url(),
263 content::PAGE_TRANSITION_TYPED); 263 content::PAGE_TRANSITION_TYPED);
264 captive_portal::CaptivePortalTabHelper* captive_portal_tab_helper = 264 captive_portal::CaptivePortalTabHelper* captive_portal_tab_helper =
265 captive_portal::CaptivePortalTabHelper::FromWebContents( 265 captive_portal::CaptivePortalTabHelper::FromWebContents(
266 tab_contents->web_contents()); 266 tab_contents->web_contents());
267 captive_portal_tab_helper->SetIsLoginTab(); 267 captive_portal_tab_helper->SetIsLoginTab();
268 } 268 }
269 269
270 } // namespace captive_portal 270 } // namespace captive_portal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698