OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/net/network_change_notifier_chromeos.h" | 5 #include "chrome/browser/chromeos/net/network_change_notifier_chromeos.h" |
6 | 6 |
7 #include "base/task.h" | 7 #include "base/task.h" |
8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
9 #include "content/browser/browser_thread.h" | 9 #include "content/browser/browser_thread.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 // Delay for online change notification reporting. | 13 // Delay for online change notification reporting. |
14 const int kOnlineNotificationDelayMS = 500; | 14 const int kOnlineNotificationDelayMS = 500; |
15 | 15 |
16 bool IsOnline(chromeos::ConnectionState state) { | 16 bool IsOnline(chromeos::ConnectionState state) { |
17 return state == chromeos::STATE_ONLINE; | 17 return state == chromeos::STATE_ONLINE || |
| 18 state == chromeos::STATE_PORTAL; |
18 } | 19 } |
19 | 20 |
20 } | 21 } |
21 | 22 |
22 namespace chromeos { | 23 namespace chromeos { |
23 | 24 |
24 // Task for fetching tokens from UI thread. | 25 // Task for fetching tokens from UI thread. |
25 class OnlineStatusReportThreadTask : public CancelableTask { | 26 class OnlineStatusReportThreadTask : public CancelableTask { |
26 public: | 27 public: |
27 OnlineStatusReportThreadTask(NetworkChangeNotifierChromeos* parent, | 28 OnlineStatusReportThreadTask(NetworkChangeNotifierChromeos* parent, |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 255 |
255 // static | 256 // static |
256 void NetworkChangeNotifierChromeos::UpdateInitialState( | 257 void NetworkChangeNotifierChromeos::UpdateInitialState( |
257 NetworkChangeNotifierChromeos* self) { | 258 NetworkChangeNotifierChromeos* self) { |
258 chromeos::NetworkLibrary* net = | 259 chromeos::NetworkLibrary* net = |
259 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); | 260 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); |
260 self->UpdateNetworkState(net); | 261 self->UpdateNetworkState(net); |
261 } | 262 } |
262 | 263 |
263 } // namespace net | 264 } // namespace net |
OLD | NEW |