Index: chrome/browser/captive_portal/captive_portal_service.cc |
=================================================================== |
--- chrome/browser/captive_portal/captive_portal_service.cc (revision 148558) |
+++ chrome/browser/captive_portal/captive_portal_service.cc (working copy) |
@@ -13,7 +13,6 @@ |
#include "base/string_number_conversions.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/chrome_notification_types.h" |
-#include "chrome/common/chrome_switches.h" |
#include "chrome/common/pref_names.h" |
#include "content/public/browser/notification_service.h" |
#include "net/base/load_flags.h" |
@@ -95,6 +94,8 @@ |
} // namespace |
+bool CaptivePortalService::is_disabled_for_testing_ = false; |
+ |
class CaptivePortalService::RecheckBackoffEntry : public net::BackoffEntry { |
public: |
explicit RecheckBackoffEntry(CaptivePortalService* captive_portal_service) |
@@ -326,9 +327,8 @@ |
void CaptivePortalService::UpdateEnabledState() { |
bool enabled_before = enabled_; |
- enabled_ = resolve_errors_with_web_service_.GetValue() && |
- CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kCaptivePortalDetection); |
+ enabled_ = !is_disabled_for_testing_ && |
+ resolve_errors_with_web_service_.GetValue(); |
if (enabled_before == enabled_) |
return; |