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

Unified Diff: chrome/browser/ui/website_settings/permission_bubble_responder.h

Issue 1154943008: Update push messaging tests to use both infobars and bubbles (w/ autoresponse) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Factor out the GetPermissionBubbleManager calls Created 5 years, 7 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/ui/website_settings/permission_bubble_responder.h
diff --git a/chrome/browser/ui/website_settings/permission_bubble_responder.h b/chrome/browser/ui/website_settings/permission_bubble_responder.h
new file mode 100644
index 0000000000000000000000000000000000000000..5ff36e88d1624473fda8f6e9d25cb4754682e3c7
--- /dev/null
+++ b/chrome/browser/ui/website_settings/permission_bubble_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_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_RESPONDER_H_
+#define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_RESPONDER_H_
+
+#include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
+
+// Use the PermissionBubbleResponder in tests to automate accepting, denying,
+// or dismissing permission requests. This should ONLY be used for testing.
+class PermissionBubbleResponder : public PermissionBubbleManager::Observer {
+ public:
+ enum BubbleResponse {
+ ACCEPT_ALL,
+ DENY_ALL,
+ DISMISS
+ };
+
+ PermissionBubbleResponder(PermissionBubbleManager* manager,
+ BubbleResponse desired_response);
+ ~PermissionBubbleResponder() override;
+
+ // PermissionBubbleManager::Observer:
+ void OnBubbleAdded() override;
+
+ private:
+ void Respond();
+
+ PermissionBubbleManager* manager_;
+ const BubbleResponse desired_response_;
+
+ DISALLOW_COPY_AND_ASSIGN(PermissionBubbleResponder);
+};
+
+#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_RESPONDER_H_

Powered by Google App Engine
This is Rietveld 408576698