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

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: Remove blank line 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..8285c9b5f16e583108e1f605d96734f905c470d5 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,26 @@ 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(const Params& params,
+ const GURL& url,
int child_id,
int route_id);
@@ -52,9 +63,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