OLD | NEW |
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_INFOBAR_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTO_LOGIN_INFOBAR_DELEGATE_H_ |
6 #define CHROME_BROWSER_UI_AUTO_LOGIN_INFOBAR_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_AUTO_LOGIN_INFOBAR_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 9 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
10 #include "components/auto_login_parser/auto_login_parser.h" | 10 #include "components/auto_login_parser/auto_login_parser.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 struct Params { | 25 struct Params { |
26 // Information from a parsed header. | 26 // Information from a parsed header. |
27 auto_login_parser::HeaderData header; | 27 auto_login_parser::HeaderData header; |
28 | 28 |
29 // Username to display in the infobar indicating user to be logged in as. | 29 // Username to display in the infobar indicating user to be logged in as. |
30 // This is initially fetched from sign-in on non-Android platforms. Note | 30 // This is initially fetched from sign-in on non-Android platforms. Note |
31 // that on Android this field is not used. | 31 // that on Android this field is not used. |
32 std::string username; | 32 std::string username; |
33 }; | 33 }; |
34 | 34 |
35 // Creates an autologin infobar delegate and adds it to |infobar_service|. | 35 // Creates an autologin infobar and delegate and adds the infobar to |
| 36 // |infobar_service|. |
36 static void Create(InfoBarService* infobar_service, const Params& params); | 37 static void Create(InfoBarService* infobar_service, const Params& params); |
37 | 38 |
38 protected: | 39 protected: |
39 AutoLoginInfoBarDelegate(InfoBarService* owner, const Params& params); | 40 explicit AutoLoginInfoBarDelegate(const Params& params); |
40 virtual ~AutoLoginInfoBarDelegate(); | 41 virtual ~AutoLoginInfoBarDelegate(); |
41 | 42 |
42 private: | 43 private: |
43 // Enum values used for UMA histograms. | 44 // Enum values used for UMA histograms. |
44 enum Actions { | 45 enum Actions { |
45 SHOWN, // The infobar was shown to the user. | 46 SHOWN, // The infobar was shown to the user. |
46 ACCEPTED, // The user pressed the accept button. | 47 ACCEPTED, // The user pressed the accept button. |
47 REJECTED, // The user pressed the reject button. | 48 REJECTED, // The user pressed the reject button. |
48 DISMISSED, // The user pressed the close button. | 49 DISMISSED, // The user pressed the close button. |
49 IGNORED, // The user ignored the infobar. | 50 IGNORED, // The user ignored the infobar. |
(...skipping 23 matching lines...) Expand all Loading... |
73 // Whether any UI controls in the infobar were pressed or not. | 74 // Whether any UI controls in the infobar were pressed or not. |
74 bool button_pressed_; | 75 bool button_pressed_; |
75 | 76 |
76 // For listening to the user signing out. | 77 // For listening to the user signing out. |
77 content::NotificationRegistrar registrar_; | 78 content::NotificationRegistrar registrar_; |
78 | 79 |
79 DISALLOW_COPY_AND_ASSIGN(AutoLoginInfoBarDelegate); | 80 DISALLOW_COPY_AND_ASSIGN(AutoLoginInfoBarDelegate); |
80 }; | 81 }; |
81 | 82 |
82 #endif // CHROME_BROWSER_UI_AUTO_LOGIN_INFOBAR_DELEGATE_H_ | 83 #endif // CHROME_BROWSER_UI_AUTO_LOGIN_INFOBAR_DELEGATE_H_ |
OLD | NEW |