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

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 Peter'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
« no previous file with comments | « chrome/browser/ui/auto_login_info_bar_delegate.h ('k') | chrome/browser/ui/auto_login_prompter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6cd0772eb124fdf824434872481fe190ffe1bf63 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());
}
@@ -139,13 +136,16 @@ void AutoLoginRedirector::RedirectToMergeSession(const std::string& token) {
// AutoLoginInfoBarDelegate ---------------------------------------------------
+// AutoLoginInfoBarDelegate::Params -------------------------------------------
+
+AutoLoginInfoBarDelegate::Params::Params() {}
+AutoLoginInfoBarDelegate::Params::~Params() {}
+
AutoLoginInfoBarDelegate::AutoLoginInfoBarDelegate(
InfoBarTabHelper* owner,
- const std::string& username,
- const std::string& args)
+ const Params& params)
: ConfirmInfoBarDelegate(owner),
- username_(username),
- args_(args),
+ params_(params),
button_pressed_(false) {
RecordHistogramAction(HISTOGRAM_SHOWN);
}
@@ -155,6 +155,11 @@ AutoLoginInfoBarDelegate::~AutoLoginInfoBarDelegate() {
RecordHistogramAction(HISTOGRAM_IGNORED);
}
+AutoLoginInfoBarDelegate*
+ AutoLoginInfoBarDelegate::AsAutoLoginInfoBarDelegate() {
+ return this;
+}
+
void AutoLoginInfoBarDelegate::InfoBarDismissed() {
RecordHistogramAction(HISTOGRAM_DISMISSED);
button_pressed_ = true;
@@ -170,8 +175,7 @@ InfoBarDelegate::Type AutoLoginInfoBarDelegate::GetInfoBarType() const {
}
string16 AutoLoginInfoBarDelegate::GetMessageText() const {
- return l10n_util::GetStringFUTF16(IDS_AUTOLOGIN_INFOBAR_MESSAGE,
- UTF8ToUTF16(username_));
+ return GetMessageText(params_.username);
}
string16 AutoLoginInfoBarDelegate::GetButtonLabel(
@@ -182,7 +186,8 @@ string16 AutoLoginInfoBarDelegate::GetButtonLabel(
bool AutoLoginInfoBarDelegate::Accept() {
// AutoLoginRedirector deletes itself.
- new AutoLoginRedirector(&owner()->web_contents()->GetController(), args_);
+ new AutoLoginRedirector(&owner()->web_contents()->GetController(),
+ params_.args);
RecordHistogramAction(HISTOGRAM_ACCEPTED);
button_pressed_ = true;
return true;
@@ -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);
}
« no previous file with comments | « chrome/browser/ui/auto_login_info_bar_delegate.h ('k') | chrome/browser/ui/auto_login_prompter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698