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

Unified Diff: chrome/browser/ui/auto_login_prompter.h

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
Index: chrome/browser/ui/auto_login_prompter.h
diff --git a/chrome/browser/ui/auto_login_prompter.h b/chrome/browser/ui/auto_login_prompter.h
index 7dd9d9deede56056ad229ee42dffd49e1f6fd78f..f91b28038e1eb8d24daec8c2ec6b0b357865ee2a 100644
--- a/chrome/browser/ui/auto_login_prompter.h
+++ b/chrome/browser/ui/auto_login_prompter.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_UI_AUTO_LOGIN_PROMPTER_H_
#include <string>
+
#include "base/compiler_specific.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -34,16 +35,27 @@ class AutoLoginPrompter : public content::NotificationObserver {
int route_id);
private:
+ friend class AutoLoginPrompterTest;
+
+ struct Params {
+ Params();
+ ~Params();
+
+ // Extracted from X-Auto-Login header.
+ std::string realm;
+ std::string account;
+ std::string args;
+ // Fetched through sync on non-Android platforms.
+ std::string username;
+ };
+
AutoLoginPrompter(content::WebContents* web_contents,
- const std::string& username,
- const std::string& args);
+ const Params& params);
virtual ~AutoLoginPrompter();
- // The portion of ShowInfoBarIfPossible() that needs to run on the UI thread.
- static void ShowInfoBarUIThread(const std::string& account,
- const std::string& args,
- const GURL& original_url,
+ static void ShowInfoBarUIThread(Params params,
Roger Tawa OOO till Jul 10th 2012/06/28 14:39:56 const ref params?
Philippe 2012/06/28 15:18:27 That's what we had a few patch sets ago :) Peter s
Roger Tawa OOO till Jul 10th 2012/06/28 15:31:51 OK sorry, I didn't see Peter's comment. It just s
+ const GURL& url,
int child_id,
int route_id);
@@ -52,9 +64,11 @@ class AutoLoginPrompter : public content::NotificationObserver {
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // Returns whether parsing succeeded.
+ static bool ParseAutoLoginHeader(const std::string& input, Params* output);
+
content::WebContents* web_contents_;
- const std::string username_;
- const std::string args_;
+ const Params params_;
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(AutoLoginPrompter);

Powered by Google App Engine
This is Rietveld 408576698