Chromium Code Reviews| Index: chrome/browser/infobars/infobar_responder.h |
| diff --git a/chrome/browser/infobars/infobar_responder.h b/chrome/browser/infobars/infobar_responder.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..eb481dd99fb97e0f2a923bd49be01f4bf32fbc46 |
| --- /dev/null |
| +++ b/chrome/browser/infobars/infobar_responder.h |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_INFOBARS_INFOBAR_RESPONDER_H_ |
| +#define CHROME_BROWSER_INFOBARS_INFOBAR_RESPONDER_H_ |
| + |
| +#include "components/infobars/core/infobar_manager.h" |
| + |
| +namespace infobars { |
| +class InfoBar; |
| +} |
| + |
| +class ConfirmInfoBarDelegate; |
| +class InfoBarService; |
| + |
| +// Accepts or rejects the first shown confirm infobar. The infobar will be |
| +// handled asynchronously, to imitate the behavior of a real person. For use in |
| +// 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.
|
| +class InfoBarResponder : public infobars::InfoBarManager::Observer { |
| + public: |
| + 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.
|
| + ~InfoBarResponder() override; |
| + |
| + // 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.
|
| + void OnInfoBarAdded(infobars::InfoBar* infobar) override; |
| + |
| + private: |
| + void Respond(ConfirmInfoBarDelegate* delegate); |
| + |
| + InfoBarService* infobar_service_; |
| + bool accept_; |
| + 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.
|
| +}; |
|
Peter Kasting
2015/04/23 00:14:08
Nit: DISALLOW_COPY_AND_ASSIGN
Michael van Ouwerkerk
2015/04/23 13:36:10
Done.
|
| + |
| +#endif // CHROME_BROWSER_INFOBARS_INFOBAR_RESPONDER_H_ |