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

Side by Side 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 Nico's comments Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_AUTO_LOGIN_INFO_BAR_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_UI_AUTO_LOGIN_INFO_BAR_DELEGATE_H_
6 #define CHROME_BROWSER_UI_AUTO_LOGIN_INFO_BAR_DELEGATE_H_ 6 #define CHROME_BROWSER_UI_AUTO_LOGIN_INFO_BAR_DELEGATE_H_
7 7
8 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h" 8 #include "chrome/browser/tab_contents/confirm_infobar_delegate.h"
9 9
10 class InfoBarTabHelper; 10 class InfoBarTabHelper;
11 class PrefService; 11 class PrefService;
12 class TokenService; 12 class TokenService;
13 13
14 namespace content { 14 namespace content {
15 class NavigationController; 15 class NavigationController;
16 } // namespace content 16 } // namespace content
17 17
18 // This is the actual infobar displayed to prompt the user to auto-login. 18 // This is the actual infobar displayed to prompt the user to auto-login.
19 class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate { 19 class AutoLoginInfoBarDelegate : public ConfirmInfoBarDelegate {
20 public: 20 public:
21 AutoLoginInfoBarDelegate(InfoBarTabHelper* owner, 21 AutoLoginInfoBarDelegate(InfoBarTabHelper* owner,
22 const std::string& username, 22 const std::string& realm,
23 const std::string& args); 23 const std::string& account,
24 const std::string& args,
25 const std::string& username);
24 virtual ~AutoLoginInfoBarDelegate(); 26 virtual ~AutoLoginInfoBarDelegate();
25 27
26 private: 28 // InfoBarDelegate:
27 // ConfirmInfoBarDelegate overrides. 29 virtual AutoLoginInfoBarDelegate* AsAutoLoginInfoBarDelegate() OVERRIDE;
Peter Kasting 2012/06/27 17:39:05 Nit: AutoLoginInfoBarDelegate doesn't inherit dire
Philippe 2012/06/28 09:24:00 Done.
30
31 // ConfirmInfoBarDelegate:
28 virtual void InfoBarDismissed() OVERRIDE; 32 virtual void InfoBarDismissed() OVERRIDE;
29 virtual gfx::Image* GetIcon() const OVERRIDE; 33 virtual gfx::Image* GetIcon() const OVERRIDE;
30 virtual Type GetInfoBarType() const OVERRIDE; 34 virtual Type GetInfoBarType() const OVERRIDE;
31 virtual string16 GetMessageText() const OVERRIDE; 35 virtual string16 GetMessageText() const OVERRIDE;
32 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE; 36 virtual string16 GetButtonLabel(InfoBarButton button) const OVERRIDE;
33 virtual bool Accept() OVERRIDE; 37 virtual bool Accept() OVERRIDE;
34 virtual bool Cancel() OVERRIDE; 38 virtual bool Cancel() OVERRIDE;
35 39
40 string16 GetMessageText(const std::string& username) const;
Peter Kasting 2012/06/27 17:39:05 Similar to my question about the downcast routine:
Philippe 2012/06/28 09:24:00 We use that in the Android implementation of the a
41
42 const std::string& realm() const {
Peter Kasting 2012/06/27 17:39:05 Nit: All on one line (3 places)
Philippe 2012/06/28 09:24:00 Done.
43 return realm_;
44 }
45
Peter Kasting 2012/06/27 17:39:05 Nit: Remove blank lines between getters
Philippe 2012/06/28 09:24:00 Done.
46 const std::string& account() const {
47 return account_;
48 }
49
50 const std::string& args() const {
51 return args_;
52 }
53
54 private:
36 void RecordHistogramAction(int action); 55 void RecordHistogramAction(int action);
37 56
38 // Username to display in the infobar indicating user to be logged in as. 57 // "realm" string from x-auto-login (e.g. "com.google").
58 std::string realm_;
59
60 // "account" string from x-auto-login.
61 std::string account_;
62
63 // "args" string from x-auto-login to be passed to MergeSession. This string
64 // should be considered opaque and not be cracked open to look inside.
65 std::string args_;
66
67 // Username to display in the infobar indicating user to be logged in as. This
68 // was initially fetched from sync on non-Android platforms.
39 std::string username_; 69 std::string username_;
40 70
41 // "args" string from x-auto-login to be passed to MergeSession. This
42 // string should be considered opaque and not be cracked open to look inside.
43 std::string args_;
44
45 // Whether any UI controls in the infobar were pressed or not. 71 // Whether any UI controls in the infobar were pressed or not.
46 bool button_pressed_; 72 bool button_pressed_;
47 73
48 DISALLOW_COPY_AND_ASSIGN(AutoLoginInfoBarDelegate); 74 DISALLOW_COPY_AND_ASSIGN(AutoLoginInfoBarDelegate);
49 }; 75 };
50 76
51 #endif // CHROME_BROWSER_UI_AUTO_LOGIN_INFO_BAR_DELEGATE_H_ 77 #endif // CHROME_BROWSER_UI_AUTO_LOGIN_INFO_BAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698