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

Unified Diff: chrome/browser/infobars/infobar_responder.h

Issue 1100953002: Move InfoBarResponder into its own file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace the notifications fork. Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
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_
« no previous file with comments | « no previous file | chrome/browser/infobars/infobar_responder.cc » ('j') | chrome/browser/infobars/infobar_responder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698