OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_INFOBARS_INFOBAR_RESPONDER_H_ | |
6 #define CHROME_BROWSER_INFOBARS_INFOBAR_RESPONDER_H_ | |
7 | |
8 #include "components/infobars/core/infobar_manager.h" | |
9 | |
10 namespace infobars { | |
11 class InfoBar; | |
12 } | |
13 | |
14 class ConfirmInfoBarDelegate; | |
15 class InfoBarService; | |
16 | |
17 // Accepts or rejects the first shown confirm infobar. The infobar will be | |
18 // handled asynchronously, to imitate the behavior of a real person. For use in | |
19 // tests. | |
Peter Kasting
2015/04/23 00:14:08
Nit: How about:
Used by test code to asynchronous
Michael van Ouwerkerk
2015/04/23 13:36:09
Done.
| |
20 class InfoBarResponder : public infobars::InfoBarManager::Observer { | |
21 public: | |
22 InfoBarResponder(InfoBarService* infobar_service, bool accept); | |
Peter Kasting
2015/04/23 00:14:08
Nit: Change name to |should_accept| (also the memb
Michael van Ouwerkerk
2015/04/23 13:36:09
Done.
| |
23 ~InfoBarResponder() override; | |
24 | |
25 // infobars::InfoBarManager::Observer | |
Peter Kasting
2015/04/23 00:14:08
Nit: Add trailing colon
Michael van Ouwerkerk
2015/04/23 13:36:09
Done.
| |
26 void OnInfoBarAdded(infobars::InfoBar* infobar) override; | |
27 | |
28 private: | |
29 void Respond(ConfirmInfoBarDelegate* delegate); | |
30 | |
31 InfoBarService* infobar_service_; | |
32 bool accept_; | |
33 bool has_observed_; | |
Peter Kasting
2015/04/23 00:14:08
Nit: |infobar_seen_| might be slightly more descri
Michael van Ouwerkerk
2015/04/23 13:36:10
No longer needed.
| |
34 }; | |
Peter Kasting
2015/04/23 00:14:08
Nit: DISALLOW_COPY_AND_ASSIGN
Michael van Ouwerkerk
2015/04/23 13:36:10
Done.
| |
35 | |
36 #endif // CHROME_BROWSER_INFOBARS_INFOBAR_RESPONDER_H_ | |
OLD | NEW |