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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 } | 347 } |
348 | 348 |
349 return proxies; | 349 return proxies; |
350 } | 350 } |
351 | 351 |
352 void DataReductionProxySettings::SetDataReductionProxyEnabled(bool enabled) { | 352 void DataReductionProxySettings::SetDataReductionProxyEnabled(bool enabled) { |
353 // Prevent configuring the proxy when it is not allowed to be used. | 353 // Prevent configuring the proxy when it is not allowed to be used. |
354 if (!IsDataReductionProxyAllowed()) | 354 if (!IsDataReductionProxyAllowed()) |
355 return; | 355 return; |
356 | 356 |
357 spdy_proxy_auth_enabled_.SetValue(enabled); | 357 if (spdy_proxy_auth_enabled_.GetValue() != enabled) { |
358 OnProxyEnabledPrefChange(); | 358 spdy_proxy_auth_enabled_.SetValue(enabled); |
| 359 OnProxyEnabledPrefChange(); |
| 360 } |
359 } | 361 } |
360 | 362 |
361 int64 DataReductionProxySettings::GetDataReductionLastUpdateTime() { | 363 int64 DataReductionProxySettings::GetDataReductionLastUpdateTime() { |
362 PrefService* local_state = GetLocalStatePrefs(); | 364 PrefService* local_state = GetLocalStatePrefs(); |
363 int64 last_update_internal = | 365 int64 last_update_internal = |
364 local_state->GetInt64(prefs::kDailyHttpContentLengthLastUpdateDate); | 366 local_state->GetInt64(prefs::kDailyHttpContentLengthLastUpdateDate); |
365 base::Time last_update = base::Time::FromInternalValue(last_update_internal); | 367 base::Time last_update = base::Time::FromInternalValue(last_update_internal); |
366 return static_cast<int64>(last_update.ToJsTime()); | 368 return static_cast<int64>(last_update.ToJsTime()); |
367 } | 369 } |
368 | 370 |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 } | 681 } |
680 | 682 |
681 void | 683 void |
682 DataReductionProxySettings::ProbeWhetherDataReductionProxyIsAvailable() { | 684 DataReductionProxySettings::ProbeWhetherDataReductionProxyIsAvailable() { |
683 net::URLFetcher* fetcher = GetURLFetcher(); | 685 net::URLFetcher* fetcher = GetURLFetcher(); |
684 if (!fetcher) | 686 if (!fetcher) |
685 return; | 687 return; |
686 fetcher_.reset(fetcher); | 688 fetcher_.reset(fetcher); |
687 fetcher_->Start(); | 689 fetcher_->Start(); |
688 } | 690 } |
OLD | NEW |