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

Unified Diff: google_apis/gaia/gaia_auth_util.cc

Issue 11091048: Add helper function to test that a given URL is a valid Gaia sign in URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 2 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
« no previous file with comments | « google_apis/gaia/gaia_auth_util.h ('k') | google_apis/gaia/gaia_auth_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gaia/gaia_auth_util.cc
diff --git a/google_apis/gaia/gaia_auth_util.cc b/google_apis/gaia/gaia_auth_util.cc
index d8cac90d54ca2f2a71cbdef2c71ab012bc1ae7de..17fcae69bc469b1192ab04ad94d936593b17447c 100644
--- a/google_apis/gaia/gaia_auth_util.cc
+++ b/google_apis/gaia/gaia_auth_util.cc
@@ -9,6 +9,8 @@
#include "base/logging.h"
#include "base/string_split.h"
#include "base/string_util.h"
+#include "google_apis/gaia/gaia_urls.h"
+#include "googleurl/src/gurl.h"
namespace gaia {
@@ -58,4 +60,13 @@ std::string ExtractDomainName(const std::string& email_address) {
return std::string();
}
+bool IsGaiaSignonRealm(const GURL& url) {
+ if (!url.SchemeIsSecure())
+ return false;
+
+ // Also check "https://www.google.com" to support old style dasher logins.
+ return url == GURL(GaiaUrls::GetInstance()->gaia_origin_url()) ||
+ url == GURL("https://www.google.com/");
+}
+
} // namespace gaia
« no previous file with comments | « google_apis/gaia/gaia_auth_util.h ('k') | google_apis/gaia/gaia_auth_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698