| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h" | 5 #include "chrome/browser/net/spdyproxy/data_reduction_proxy_settings.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 bool IsProxyOriginSetOnCommandLine() { | 71 bool IsProxyOriginSetOnCommandLine() { |
| 72 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 72 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 73 return command_line.HasSwitch(switches::kSpdyProxyAuthOrigin); | 73 return command_line.HasSwitch(switches::kSpdyProxyAuthOrigin); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace | 76 } // namespace |
| 77 | 77 |
| 78 DataReductionProxySettings::DataReductionProxySettings() | 78 DataReductionProxySettings::DataReductionProxySettings() |
| 79 : has_turned_on_(false), | 79 : disabled_by_carrier_(false), |
| 80 has_turned_off_(false), | |
| 81 disabled_by_carrier_(false), | |
| 82 enabled_by_user_(false) { | 80 enabled_by_user_(false) { |
| 83 } | 81 } |
| 84 | 82 |
| 85 DataReductionProxySettings::~DataReductionProxySettings() { | 83 DataReductionProxySettings::~DataReductionProxySettings() { |
| 86 if (IsDataReductionProxyAllowed()) | 84 if (IsDataReductionProxyAllowed()) |
| 87 spdy_proxy_auth_enabled_.Destroy(); | 85 spdy_proxy_auth_enabled_.Destroy(); |
| 88 } | 86 } |
| 89 | 87 |
| 90 void DataReductionProxySettings::InitPrefMembers() { | 88 void DataReductionProxySettings::InitPrefMembers() { |
| 91 spdy_proxy_auth_enabled_.Init( | 89 spdy_proxy_auth_enabled_.Init( |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 } | 579 } |
| 582 | 580 |
| 583 void | 581 void |
| 584 DataReductionProxySettings::ProbeWhetherDataReductionProxyIsAvailable() { | 582 DataReductionProxySettings::ProbeWhetherDataReductionProxyIsAvailable() { |
| 585 net::URLFetcher* fetcher = GetURLFetcher(); | 583 net::URLFetcher* fetcher = GetURLFetcher(); |
| 586 if (!fetcher) | 584 if (!fetcher) |
| 587 return; | 585 return; |
| 588 fetcher_.reset(fetcher); | 586 fetcher_.reset(fetcher); |
| 589 fetcher_->Start(); | 587 fetcher_->Start(); |
| 590 } | 588 } |
| OLD | NEW |