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

Unified Diff: chrome/browser/ui/auto_login_info_bar_delegate.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
« no previous file with comments | « chrome/browser/infobars/infobar_delegate.cc ('k') | chrome/browser/ui/auto_login_info_bar_delegate.cc » ('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.h
diff --git a/chrome/browser/ui/auto_login_info_bar_delegate.h b/chrome/browser/ui/auto_login_info_bar_delegate.h
index 6ec846a0ed3490c33bf144c0c1066caba120195f..a760dbae1e4391cdec3e63110daca4b5c7e2d897 100644
--- a/chrome/browser/ui/auto_login_info_bar_delegate.h
+++ b/chrome/browser/ui/auto_login_info_bar_delegate.h
@@ -18,29 +18,51 @@ class NavigationController;
// This is the actual infobar displayed to prompt the user to auto-login.
class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate {
public:
- AutoLoginInfoBarDelegate(InfoBarTabHelper* owner,
- const std::string& username,
- const std::string& args);
+ struct Params {
+ Params();
+ ~Params();
+
+ // "realm" string from x-auto-login (e.g. "com.google").
+ std::string realm;
+
+ // "account" string from x-auto-login.
+ std::string account;
+
+ // "args" string from x-auto-login to be passed to MergeSession. This string
+ // should be considered opaque and not be cracked open to look inside.
+ std::string args;
+
+ // Username to display in the infobar indicating user to be logged in as.
+ // This is initially fetched from sign-in on non-Android platforms. Note
+ // that on Android this field is not used.
+ std::string username;
+ };
+
+ AutoLoginInfoBarDelegate(InfoBarTabHelper* owner, const Params& params);
virtual ~AutoLoginInfoBarDelegate();
- private:
- // ConfirmInfoBarDelegate overrides.
+ // ConfirmInfoBarDelegate:
virtual void InfoBarDismissed() OVERRIDE;
virtual gfx::Image* GetIcon() const OVERRIDE;
virtual Type GetInfoBarType() const OVERRIDE;
+ virtual AutoLoginInfoBarDelegate* AsAutoLoginInfoBarDelegate() OVERRIDE;
virtual string16 GetMessageText() const OVERRIDE;
virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
virtual bool Accept() OVERRIDE;
virtual bool Cancel() OVERRIDE;
- void RecordHistogramAction(int action);
+ // All the methods below are used by the Android implementation of the
+ // AutoLogin bar on the app side.
+ string16 GetMessageText(const std::string& username) const;
+
+ const std::string& realm() const { return params_.realm; }
+ const std::string& account() const { return params_.account; }
+ const std::string& args() const { return params_.args; }
- // Username to display in the infobar indicating user to be logged in as.
- std::string username_;
+ private:
+ void RecordHistogramAction(int action);
- // "args" string from x-auto-login to be passed to MergeSession. This
- // string should be considered opaque and not be cracked open to look inside.
- std::string args_;
+ const Params params_;
// Whether any UI controls in the infobar were pressed or not.
bool button_pressed_;
« no previous file with comments | « chrome/browser/infobars/infobar_delegate.cc ('k') | chrome/browser/ui/auto_login_info_bar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698