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

Side by Side Diff: chrome/browser/chromeos/net/network_portal_detector_impl.h

Issue 1353933002: NetworkPortalDetectorInterface class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@portal_refactor
Patch Set: rebase Created 5 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_
6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_ 6 #define CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 20 matching lines...) Expand all
31 31
32 namespace net { 32 namespace net {
33 class URLRequestContextGetter; 33 class URLRequestContextGetter;
34 } 34 }
35 35
36 namespace chromeos { 36 namespace chromeos {
37 37
38 class NetworkPortalNotificationController; 38 class NetworkPortalNotificationController;
39 class NetworkState; 39 class NetworkState;
40 40
41 void InitializeNetworkPortalDetector(net::URLRequestContextGetter* url_context);
42
41 // This class handles all notifications about network changes from 43 // This class handles all notifications about network changes from
42 // NetworkStateHandler and delegates portal detection for the default 44 // NetworkStateHandler and delegates portal detection for the default
43 // network to CaptivePortalService. 45 // network to CaptivePortalService.
44 class NetworkPortalDetectorImpl 46 class NetworkPortalDetectorImpl : public NetworkPortalDetectorInterface,
45 : public NetworkPortalDetector, 47 public base::NonThreadSafe,
46 public base::NonThreadSafe, 48 public chromeos::NetworkStateHandlerObserver,
47 public chromeos::NetworkStateHandlerObserver, 49 public content::NotificationObserver,
48 public content::NotificationObserver, 50 public PortalDetectorStrategy::Delegate {
49 public PortalDetectorStrategy::Delegate {
50 public: 51 public:
51 static const char kOobeDetectionResultHistogram[]; 52 static const char kOobeDetectionResultHistogram[];
52 static const char kOobeDetectionDurationHistogram[]; 53 static const char kOobeDetectionDurationHistogram[];
53 static const char kOobeShillOnlineHistogram[]; 54 static const char kOobeShillOnlineHistogram[];
54 static const char kOobeShillPortalHistogram[]; 55 static const char kOobeShillPortalHistogram[];
55 static const char kOobeShillOfflineHistogram[]; 56 static const char kOobeShillOfflineHistogram[];
56 static const char kOobePortalToOnlineHistogram[]; 57 static const char kOobePortalToOnlineHistogram[];
57 58
58 static const char kSessionDetectionResultHistogram[]; 59 static const char kSessionDetectionResultHistogram[];
59 static const char kSessionDetectionDurationHistogram[]; 60 static const char kSessionDetectionDurationHistogram[];
60 static const char kSessionShillOnlineHistogram[]; 61 static const char kSessionShillOnlineHistogram[];
61 static const char kSessionShillPortalHistogram[]; 62 static const char kSessionShillPortalHistogram[];
62 static const char kSessionShillOfflineHistogram[]; 63 static const char kSessionShillOfflineHistogram[];
63 static const char kSessionPortalToOnlineHistogram[]; 64 static const char kSessionPortalToOnlineHistogram[];
64 65
65 // Creates an instance of the implementation or a stub.
66 static void Initialize(net::URLRequestContextGetter* url_context);
67
68 NetworkPortalDetectorImpl( 66 NetworkPortalDetectorImpl(
69 const scoped_refptr<net::URLRequestContextGetter>& request_context, 67 const scoped_refptr<net::URLRequestContextGetter>& request_context,
70 bool create_notification_controller); 68 bool create_notification_controller);
71 ~NetworkPortalDetectorImpl() override; 69 ~NetworkPortalDetectorImpl() override;
72 70
73 private: 71 private:
74 friend class ::NetworkingConfigTest; 72 friend class ::NetworkingConfigTest;
75 friend class NetworkPortalDetectorImplTest; 73 friend class NetworkPortalDetectorImplTest;
76 friend class NetworkPortalDetectorImplBrowserTest; 74 friend class NetworkPortalDetectorImplBrowserTest;
77 75
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 DetectionAttemptCompletedReport attempt_completed_report_; 267 DetectionAttemptCompletedReport attempt_completed_report_;
270 268
271 base::WeakPtrFactory<NetworkPortalDetectorImpl> weak_factory_; 269 base::WeakPtrFactory<NetworkPortalDetectorImpl> weak_factory_;
272 270
273 DISALLOW_COPY_AND_ASSIGN(NetworkPortalDetectorImpl); 271 DISALLOW_COPY_AND_ASSIGN(NetworkPortalDetectorImpl);
274 }; 272 };
275 273
276 } // namespace chromeos 274 } // namespace chromeos
277 275
278 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_ 276 #endif // CHROME_BROWSER_CHROMEOS_NET_NETWORK_PORTAL_DETECTOR_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/net/delay_network_call.cc ('k') | chrome/browser/chromeos/net/network_portal_detector_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698