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

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

Issue 6469027: [cros] Report captive portal message when we suspect that might be the case. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 10 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/existing_user_controller.cc
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 74afdec650099f6db496ffc4b0f2b2ed08072dd2..5d51ce602c71c921eb73b9867f6be56188adc7e2 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -50,6 +50,9 @@ const char kGetStartedURL[] =
const char kCreateAccountURL[] =
"https://www.google.com/accounts/NewAccount?service=mail";
+// Landing URL when launching Guest mode to fix captive portal.
+const char kCaptivePortalLaunchURL[] = "http://www.google.com/";
+
// Used to handle the asynchronous response of deleting a cryptohome directory.
class RemoveAttempt : public CryptohomeLibrary::Delegate {
public:
@@ -199,6 +202,11 @@ void ExistingUserController::CreateAccount() {
LoginAsGuest();
}
+void ExistingUserController::FixCaptivePortal() {
+ guest_mode_url_ = GURL(kCaptivePortalLaunchURL);
+ LoginAsGuest();
+}
+
void ExistingUserController::Login(const std::string& username,
const std::string& password) {
if (username.empty() || password.empty())
@@ -328,6 +336,14 @@ void ExistingUserController::OnLoginFailure(const LoginFailure& failure) {
failure.error().state() ==
GoogleServiceAuthError::HOSTED_NOT_ALLOWED) {
ShowError(IDS_LOGIN_ERROR_AUTHENTICATING_HOSTED, error);
+ } else if (failure.reason() == LoginFailure::NETWORK_AUTH_FAILED &&
+ failure.error().state() ==
+ GoogleServiceAuthError::SERVICE_UNAVAILABLE) {
+ // SERVICE_UNAVAILABLE is generated in 2 cases:
+ // 1. ClientLogin returns ServiceUnavailable code.
+ // 2. Internet connectivity may be behind the captive portal.
+ // Suggesting user to try sign in to a portal in Guest mode.
+ ShowError(IDS_LOGIN_ERROR_CAPTIVE_PORTAL, error);
} else {
if (!UserManager::Get()->IsKnownUser(last_login_attempt_username_))
ShowError(IDS_LOGIN_ERROR_AUTHENTICATING_NEW, error);
« no previous file with comments | « chrome/browser/chromeos/login/existing_user_controller.h ('k') | chrome/browser/chromeos/login/login_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698