Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Side by Side Diff: chrome/browser/chromeos/net/network_change_notifier_chromeos.cc

Issue 7779040: Start moving code from BrowserMain to content, so that it can be reused by all embedders of conte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix windows unittest Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 NewRunnableFunction( 74 NewRunnableFunction(
75 &NetworkChangeNotifierChromeos::UpdateInitialState, this), 75 &NetworkChangeNotifierChromeos::UpdateInitialState, this),
76 kOnlineNotificationDelayMS); 76 kOnlineNotificationDelayMS);
77 } 77 }
78 78
79 NetworkChangeNotifierChromeos::~NetworkChangeNotifierChromeos() { 79 NetworkChangeNotifierChromeos::~NetworkChangeNotifierChromeos() {
80 if (online_notification_task_) { 80 if (online_notification_task_) {
81 online_notification_task_->Cancel(); 81 online_notification_task_->Cancel();
82 online_notification_task_ = NULL; 82 online_notification_task_ = NULL;
83 } 83 }
84 if (!chromeos::CrosLibrary::Get())
85 return;
84 chromeos::NetworkLibrary* lib = 86 chromeos::NetworkLibrary* lib =
85 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); 87 chromeos::CrosLibrary::Get()->GetNetworkLibrary();
86 lib->RemoveNetworkManagerObserver(this); 88 lib->RemoveNetworkManagerObserver(this);
87 lib->RemoveObserverForAllNetworks(this); 89 lib->RemoveObserverForAllNetworks(this);
88 90
89 chromeos::PowerLibrary* power = 91 chromeos::PowerLibrary* power =
90 chromeos::CrosLibrary::Get()->GetPowerLibrary(); 92 chromeos::CrosLibrary::Get()->GetPowerLibrary();
91 power->RemoveObserver(this); 93 power->RemoveObserver(this);
92 } 94 }
93 95
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 254
253 // static 255 // static
254 void NetworkChangeNotifierChromeos::UpdateInitialState( 256 void NetworkChangeNotifierChromeos::UpdateInitialState(
255 NetworkChangeNotifierChromeos* self) { 257 NetworkChangeNotifierChromeos* self) {
256 chromeos::NetworkLibrary* net = 258 chromeos::NetworkLibrary* net =
257 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); 259 chromeos::CrosLibrary::Get()->GetNetworkLibrary();
258 self->UpdateNetworkState(net); 260 self->UpdateNetworkState(net);
259 } 261 }
260 262
261 } // namespace net 263 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698