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