Index: chrome/browser/captive_portal/captive_portal_service.cc |
=================================================================== |
--- chrome/browser/captive_portal/captive_portal_service.cc (revision 147935) |
+++ chrome/browser/captive_portal/captive_portal_service.cc (working copy) |
@@ -326,9 +326,21 @@ |
void CaptivePortalService::UpdateEnabledState() { |
bool enabled_before = enabled_; |
- enabled_ = resolve_errors_with_web_service_.GetValue() && |
- CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kCaptivePortalDetection); |
+ |
+ // Default value. |
+ bool allowed_by_command_line = true; |
+ |
+ std::string command_line_value = |
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
+ switches::kCaptivePortalDetection); |
+ if (command_line_value == switches::kCaptivePortalDetectionDisabled) { |
+ allowed_by_command_line = false; |
+ } else if (command_line_value == switches::kCaptivePortalDetectionEnabled) { |
+ allowed_by_command_line = true; |
+ } |
+ |
+ enabled_ = allowed_by_command_line && |
+ resolve_errors_with_web_service_.GetValue(); |
if (enabled_before == enabled_) |
return; |