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

Unified Diff: chrome/browser/ui/webui/signin/inline_login_handler_impl.cc

Issue 171533014: Revert of Implement inline signin with iframe (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/ui/webui/signin/inline_login_handler_impl.cc
diff --git a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
index 7b403c6fea48a735b0cadc0589a3f82c83544f70..cf30c5a470ecfd4a4bcab371378a7dc74c44ab21 100644
--- a/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
+++ b/chrome/browser/ui/webui/signin/inline_login_handler_impl.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h"
+#include "base/atomic_sequence_num.h"
#include "base/bind.h"
#include "base/prefs/pref_service.h"
#include "base/strings/string_number_conversions.h"
@@ -19,7 +20,6 @@
#include "chrome/browser/ui/sync/one_click_signin_helper.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/pref_names.h"
-#include "chrome/common/url_constants.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
@@ -30,10 +30,13 @@
namespace {
+// Global SequenceNumber used for generating unique webview partition IDs.
+base::StaticAtomicSequenceNumber next_partition_id;
+
} // empty namespace
InlineLoginHandlerImpl::InlineLoginHandlerImpl()
- : weak_factory_(this), choose_what_to_sync_(false) {
+ : weak_factory_(this), choose_what_to_sync_(false), partition_id_("") {
}
InlineLoginHandlerImpl::~InlineLoginHandlerImpl() {}
@@ -47,7 +50,7 @@
}
void InlineLoginHandlerImpl::SetExtraInitParams(base::DictionaryValue& params) {
- params.SetInteger("authMode", InlineLoginHandler::kDesktopAuthMode);
+ params.SetInteger("authMode", InlineLoginHandler::kInlineAuthMode);
const GURL& current_url = web_ui()->GetWebContents()->GetURL();
signin::Source source = signin::GetSourceForPromoURL(current_url);
@@ -89,6 +92,13 @@
net::GetValueForKeyInQuery(current_url, "readOnlyEmail", &read_only_email);
if (!read_only_email.empty())
params.SetString("readOnlyEmail", read_only_email);
+
+ net::GetValueForKeyInQuery(current_url, "partitionId", &partition_id_);
+ if (partition_id_.empty()) {
+ partition_id_ =
+ "gaia-webview-" + base::IntToString(next_partition_id.GetNext());
+ }
+ params.SetString("partitionId", partition_id_);
}
@@ -101,6 +111,8 @@
GURL main_frame_url(web_contents->GetURL());
main_frame_url = net::AppendOrReplaceQueryParameter(
main_frame_url, "frameUrl", UTF16ToASCII(url_str));
+ main_frame_url = net::AppendOrReplaceQueryParameter(
+ main_frame_url, "partitionId", partition_id_);
chrome::NavigateParams params(
Profile::FromWebUI(web_ui()),
net::AppendOrReplaceQueryParameter(main_frame_url, "constrained", "0"),
@@ -111,7 +123,7 @@
}
void InlineLoginHandlerImpl::CompleteLogin(const base::ListValue* args) {
- DCHECK(email_.empty() && password_.empty() && session_index_.empty());
+ DCHECK(email_.empty() && password_.empty());
content::WebContents* contents = web_ui()->GetWebContents();
const GURL& current_url = contents->GetURL();
@@ -150,10 +162,6 @@
}
}
- base::string16 session_index;
- dict->GetString("sessionIndex", &session_index);
- session_index_ = UTF16ToASCII(session_index);
- DCHECK(!session_index_.empty());
dict->GetBoolean("chooseWhatToSync", &choose_what_to_sync_);
signin::Source source = signin::GetSourceForPromoURL(current_url);
@@ -172,12 +180,13 @@
content::StoragePartition* partition =
content::BrowserContext::GetStoragePartitionForSite(
contents->GetBrowserContext(),
- GURL(chrome::kChromeUIChromeSigninURL));
+ GURL("chrome-guest://mfffpogegjflfpflabcdkioaeobkgjik/?" +
+ partition_id_));
auth_fetcher_.reset(new GaiaAuthFetcher(this,
GaiaConstants::kChromeSource,
partition->GetURLRequestContext()));
- auth_fetcher_->StartCookieForOAuthCodeExchange(session_index_);
+ auth_fetcher_->StartCookieForOAuthCodeExchange("0");
}
void InlineLoginHandlerImpl::OnClientOAuthCodeSuccess(
@@ -244,7 +253,6 @@
email_.clear();
password_.clear();
- session_index_.clear();
web_ui()->CallJavascriptFunction("inline.login.closeDialog");
}
@@ -268,7 +276,6 @@
email_.clear();
password_.clear();
- session_index_.clear();
}
void InlineLoginHandlerImpl::SyncStarterCallback(
« no previous file with comments | « chrome/browser/ui/webui/signin/inline_login_handler_impl.h ('k') | chrome/browser/ui/webui/signin/inline_login_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698