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_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_RESPONDER_H_ |
| 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_RESPONDER_H_ |
| 7 |
| 8 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h" |
| 9 |
| 10 // Use the PermissionBubbleResponder in tests to automate accepting, denying, |
| 11 // or dismissing permission requests. This should ONLY be used for testing. |
| 12 class PermissionBubbleResponder : public PermissionBubbleManager::Observer { |
| 13 public: |
| 14 enum BubbleResponse { |
| 15 ACCEPT_ALL, |
| 16 DENY_ALL, |
| 17 DISMISS |
| 18 }; |
| 19 |
| 20 PermissionBubbleResponder(PermissionBubbleManager* manager, |
| 21 BubbleResponse desired_response); |
| 22 ~PermissionBubbleResponder() override; |
| 23 |
| 24 // PermissionBubbleManager::Observer: |
| 25 void OnBubbleAdded() override; |
| 26 |
| 27 private: |
| 28 void Respond(); |
| 29 |
| 30 PermissionBubbleManager* manager_; |
| 31 const BubbleResponse desired_response_; |
| 32 |
| 33 DISALLOW_COPY_AND_ASSIGN(PermissionBubbleResponder); |
| 34 }; |
| 35 |
| 36 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_PERMISSION_BUBBLE_RESPONDER_H_ |
OLD | NEW |