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

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

Issue 22264004: Remove ConnectivityStateHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix clang errors + fix nits Created 7 years, 4 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/oauth2_login_verifier.cc
diff --git a/chrome/browser/chromeos/login/oauth2_login_verifier.cc b/chrome/browser/chromeos/login/oauth2_login_verifier.cc
index ab82a377e73c76eb883e2c37ed30a0585b59c5be..70bfc5cb15199104f4003c94fee92bc974d0dcca 100644
--- a/chrome/browser/chromeos/login/oauth2_login_verifier.cc
+++ b/chrome/browser/chromeos/login/oauth2_login_verifier.cc
@@ -11,12 +11,15 @@
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
-#include "chrome/browser/chromeos/net/connectivity_state_helper.h"
#include "chrome/browser/signin/profile_oauth2_token_service.h"
#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+#include "chromeos/network/network_handler.h"
+#include "chromeos/network/network_state.h"
+#include "chromeos/network/network_state_handler.h"
#include "content/public/browser/browser_thread.h"
#include "google_apis/gaia/gaia_constants.h"
#include "google_apis/gaia/gaia_urls.h"
+#include "third_party/cros_system_api/dbus/service_constants.h"
using content::BrowserThread;
@@ -50,8 +53,10 @@ void OAuth2LoginVerifier::VerifyProfileTokens(Profile* profile) {
// Delay the verification if the network is not connected or on a captive
// portal.
- ConnectivityStateHelper* csh = ConnectivityStateHelper::Get();
- if (!csh->DefaultNetworkOnline()) {
+ const NetworkState* default_network =
+ NetworkHandler::Get()->network_state_handler()->DefaultNetwork();
+ if (!default_network ||
+ default_network->connection_state() == flimflam::kStatePortal) {
Nikita (slow) 2013/08/08 10:47:28 Previous implementation was: 173 bool Connectivit
gauravsh 2013/08/08 16:59:20 The check was redundant. A non-NULL DefaultNetwork
Nikita (slow) 2013/08/08 17:50:01 This block should be executed in 3 cases: 1. Netwo
gauravsh 2013/08/08 18:02:41 DefaultNetwork() already does the IsConnected() ch
stevenjb 2013/08/08 18:10:23 default_network is still NULL. With the new Netwo
Nikita (slow) 2013/08/09 09:44:00 Thanks for explanation.
// If network is offline, defer the token fetching until online.
VLOG(1) << "Network is offline. Deferring OAuth2 access token fetch.";
BrowserThread::PostDelayedTask(

Powered by Google App Engine
This is Rietveld 408576698