OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/intranet_redirect_detector.h" | 5 #include "chrome/browser/intranet_redirect_detector.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/command_line.h" | 10 #include "base/command_line.h" |
9 #include "base/location.h" | 11 #include "base/location.h" |
10 #include "base/prefs/pref_registry_simple.h" | 12 #include "base/prefs/pref_registry_simple.h" |
11 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
12 #include "base/rand_util.h" | 14 #include "base/rand_util.h" |
13 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
14 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
16 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 | 161 |
160 // Since presumably many programs open connections after network changes, | 162 // Since presumably many programs open connections after network changes, |
161 // delay this a little bit. | 163 // delay this a little bit. |
162 in_sleep_ = true; | 164 in_sleep_ = true; |
163 static const int kNetworkSwitchDelayMS = 1000; | 165 static const int kNetworkSwitchDelayMS = 1000; |
164 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 166 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
165 FROM_HERE, base::Bind(&IntranetRedirectDetector::FinishSleep, | 167 FROM_HERE, base::Bind(&IntranetRedirectDetector::FinishSleep, |
166 weak_ptr_factory_.GetWeakPtr()), | 168 weak_ptr_factory_.GetWeakPtr()), |
167 base::TimeDelta::FromMilliseconds(kNetworkSwitchDelayMS)); | 169 base::TimeDelta::FromMilliseconds(kNetworkSwitchDelayMS)); |
168 } | 170 } |
OLD | NEW |