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

Unified Diff: chrome/browser/ui/auto_login_info_bar_delegate.cc

Issue 10690006: Upstream changes needed by Android auto-login. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Nico's comments Created 8 years, 6 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/auto_login_info_bar_delegate.cc
diff --git a/chrome/browser/ui/auto_login_info_bar_delegate.cc b/chrome/browser/ui/auto_login_info_bar_delegate.cc
index a631bef2d060b48fdfa46c0358ce305d9e90656b..81f29b8717ba7a4547e143cb96026ffd9b848321 100644
--- a/chrome/browser/ui/auto_login_info_bar_delegate.cc
+++ b/chrome/browser/ui/auto_login_info_bar_delegate.cc
@@ -123,13 +123,10 @@ void AutoLoginRedirector::OnUbertokenFailure(
}
void AutoLoginRedirector::RedirectToMergeSession(const std::string& token) {
- // The args are URL encoded, so we need to decode them before use.
- std::string unescaped_args =
- net::UnescapeURLComponent(args_, net::UnescapeRule::URL_SPECIAL_CHARS);
// TODO(rogerta): what is the correct page transition?
navigation_controller_->LoadURL(
GURL(GaiaUrls::GetInstance()->merge_session_url() +
- "?source=chrome&uberauth=" + token + "&" + unescaped_args),
+ "?source=chrome&uberauth=" + token + "&" + args_),
content::Referrer(), content::PAGE_TRANSITION_AUTO_BOOKMARK,
std::string());
}
@@ -141,11 +138,15 @@ void AutoLoginRedirector::RedirectToMergeSession(const std::string& token) {
AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate(
InfoBarTabHelper* owner,
- const std::string& username,
- const std::string& args)
+ const std::string& realm,
+ const std::string& account,
+ const std::string& args,
+ const std::string& username)
: ConfirmInfoBarDelegate(owner),
- username_(username),
+ realm_(realm),
+ account_(account),
args_(args),
+ username_(username),
button_pressed_(false) {
RecordHistogramAction(HISTOGRAM_SHOWN);
}
@@ -155,6 +156,11 @@ AutoLoginInfoBarDelegate::~AutoLoginInfoBarDelegate() {
RecordHistogramAction(HISTOGRAM_IGNORED);
}
+AutoLoginInfoBarDelegate*
+AutoLoginInfoBarDelegate::AsAutoLoginInfoBarDelegate() {
Peter Kasting 2012/06/27 17:39:05 Nit: Indent 4
Philippe 2012/06/28 09:24:00 Done.
+ return this;
+}
+
void AutoLoginInfoBarDelegate::InfoBarDismissed() {
RecordHistogramAction(HISTOGRAM_DISMISSED);
button_pressed_ = true;
@@ -170,8 +176,7 @@ InfoBarDelegate::Type AutoLoginInfoBarDelegate::GetInfoBarType() const {
}
string16 AutoLoginInfoBarDelegate::GetMessageText() const {
- return l10n_util::GetStringFUTF16(IDS_AUTOLOGIN_INFOBAR_MESSAGE,
- UTF8ToUTF16(username_));
+ return GetMessageText(username_);
}
string16 AutoLoginInfoBarDelegate::GetButtonLabel(
@@ -197,6 +202,12 @@ bool AutoLoginInfoBarDelegate::Cancel() {
return true;
}
+string16 AutoLoginInfoBarDelegate::GetMessageText(
+ const std::string& username) const {
+ return l10n_util::GetStringFUTF16(IDS_AUTOLOGIN_INFOBAR_MESSAGE,
+ UTF8ToUTF16(username));
+}
+
void AutoLoginInfoBarDelegate::RecordHistogramAction(int action) {
UMA_HISTOGRAM_ENUMERATION("AutoLogin.Regular", action, HISTOGRAM_MAX);
}

Powered by Google App Engine
This is Rietveld 408576698