Chromium Code Reviews| 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. |
|
Peter Kasting
2012/06/27 17:39:05
Nit: Blank line above
Philippe
2012/06/28 09:24:00
Done.
|
| + 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); |