Chromium Code Reviews| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "chrome/browser/chromeos/cros/cros_library.h" | 8 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
| 10 | 10 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 NetworkChangeNotifierChromeos* parent_; | 58 NetworkChangeNotifierChromeos* parent_; |
| 59 bool is_online_; | 59 bool is_online_; |
| 60 bool should_report_; | 60 bool should_report_; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 NetworkChangeNotifierChromeos::NetworkChangeNotifierChromeos() | 63 NetworkChangeNotifierChromeos::NetworkChangeNotifierChromeos() |
| 64 : has_active_network_(false), | 64 : has_active_network_(false), |
| 65 connection_state_(chromeos::STATE_UNKNOWN), | 65 connection_state_(chromeos::STATE_UNKNOWN), |
| 66 online_notification_task_(NULL) { | 66 online_notification_task_(NULL) { |
| 67 | 67 |
| 68 chromeos::NetworkLibrary* net = | |
| 69 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); | |
| 70 net->AddNetworkManagerObserver(this); | |
| 71 | |
| 72 chromeos::PowerLibrary* power = | |
| 73 chromeos::CrosLibrary::Get()->GetPowerLibrary(); | |
| 74 power->AddObserver(this); | |
| 75 | |
| 76 UpdateNetworkState(net); | |
|
satorux1
2011/11/03 20:13:54
So I thought the removal of the line 76 was harmle
| |
| 77 BrowserThread::PostDelayedTask( | 68 BrowserThread::PostDelayedTask( |
| 78 BrowserThread::UI, FROM_HERE, | 69 BrowserThread::UI, FROM_HERE, |
| 79 base::Bind( | 70 base::Bind( |
| 80 &NetworkChangeNotifierChromeos::UpdateInitialState, this), | 71 &NetworkChangeNotifierChromeos::UpdateInitialState, this), |
| 81 kInitialNotificationCheckDelayMS); | 72 kInitialNotificationCheckDelayMS); |
| 82 } | 73 } |
| 83 | 74 |
| 84 NetworkChangeNotifierChromeos::~NetworkChangeNotifierChromeos() { | 75 NetworkChangeNotifierChromeos::~NetworkChangeNotifierChromeos() { |
| 85 if (online_notification_task_) { | 76 if (online_notification_task_) { |
| 86 online_notification_task_->Cancel(); | 77 online_notification_task_->Cancel(); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 } | 241 } |
| 251 | 242 |
| 252 // static | 243 // static |
| 253 void NetworkChangeNotifierChromeos::UpdateInitialState( | 244 void NetworkChangeNotifierChromeos::UpdateInitialState( |
| 254 NetworkChangeNotifierChromeos* self) { | 245 NetworkChangeNotifierChromeos* self) { |
| 255 chromeos::NetworkLibrary* net = | 246 chromeos::NetworkLibrary* net = |
| 256 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); | 247 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); |
| 257 self->UpdateNetworkState(net); | 248 self->UpdateNetworkState(net); |
| 258 } | 249 } |
| 259 | 250 |
| 260 } // namespace net | 251 } // namespace chromeos |
| OLD | NEW |