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

Unified Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 12729002: Add a unified observer to replace NetworkManagerObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/login_utils.cc
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index c4ecbe4b26bd2042c7f09818aa22b08927fe0f3c..bb7c356acfadd87fb20beae32c012574696d83c4 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -32,7 +32,6 @@
#include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/cryptohome_library.h"
-#include "chrome/browser/chromeos/cros/network_library.h"
#include "chrome/browser/chromeos/input_method/input_method_configuration.h"
#include "chrome/browser/chromeos/input_method/input_method_manager.h"
#include "chrome/browser/chromeos/input_method/input_method_util.h"
@@ -45,6 +44,7 @@
#include "chrome/browser/chromeos/login/screen_locker.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/net/connectivity_state_helper.h"
+#include "chrome/browser/chromeos/net/connectivity_state_helper_observer.h"
#include "chrome/browser/chromeos/policy/network_configuration_updater.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/chromeos/settings/cros_settings_names.h"
@@ -719,13 +719,12 @@ scoped_refptr<Authenticator> LoginUtilsImpl::CreateAuthenticator(
// We use a special class for this so that it can be safely leaked if we
// never connect. At shutdown the order is not well defined, and it's possible
// for the infrastructure needed to unregister might be unstable and crash.
-class WarmingObserver : public NetworkLibrary::NetworkManagerObserver,
+class WarmingObserver : public ConnectivityStateHelperObserver,
public content::NotificationObserver {
public:
WarmingObserver()
: url_request_context_getter_(NULL) {
- NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary();
- netlib->AddNetworkManagerObserver(this);
+ ConnectivityStateHelper::Get()->AddNetworkManagerObserver(this);
// During tests, the browser_process may not be initialized yet causing
// this to fail.
if (g_browser_process) {
@@ -739,15 +738,16 @@ class WarmingObserver : public NetworkLibrary::NetworkManagerObserver,
virtual ~WarmingObserver() {}
// If we're now connected, prewarm the auth url.
- virtual void OnNetworkManagerChanged(NetworkLibrary* netlib) OVERRIDE {
- if (netlib->Connected()) {
+ virtual void NetworkManagerChanged() OVERRIDE {
+ ConnectivityStateHelper* csh = ConnectivityStateHelper::Get();
+ if (csh->IsConnected()) {
const int kConnectionsNeeded = 1;
chrome_browser_net::PreconnectOnUIThread(
GURL(GaiaUrls::GetInstance()->client_login_url()),
chrome_browser_net::UrlInfo::EARLY_LOAD_MOTIVATED,
kConnectionsNeeded,
url_request_context_getter_);
- netlib->RemoveNetworkManagerObserver(this);
+ csh->RemoveNetworkManagerObserver(this);
delete this;
}
}
« no previous file with comments | « chrome/browser/chromeos/imageburner/burn_manager.cc ('k') | chrome/browser/chromeos/net/connectivity_state_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698