Chromium Code Reviews| Index: chrome/browser/ui/website_settings/mock_permission_bubble_view.h |
| diff --git a/chrome/browser/ui/website_settings/mock_permission_bubble_view.h b/chrome/browser/ui/website_settings/mock_permission_bubble_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ebdc17f46c0808b8b91d5fbe9244bc99c737503f |
| --- /dev/null |
| +++ b/chrome/browser/ui/website_settings/mock_permission_bubble_view.h |
| @@ -0,0 +1,44 @@ |
| +// 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_MOCK_PERMISSION_BUBBLE_VIEW_H_ |
| +#define CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_VIEW_H_ |
| + |
| +#include "chrome/browser/ui/website_settings/permission_bubble_request.h" |
| +#include "chrome/browser/ui/website_settings/permission_bubble_view.h" |
| + |
| +class MockPermissionBubbleView : public PermissionBubbleView { |
|
markusheintz_
2015/02/02 10:46:52
optional: I think a few words about when and how t
felt
2015/02/02 13:03:09
Done.
|
| + public: |
| + MockPermissionBubbleView(); |
| + ~MockPermissionBubbleView() override; |
| + |
| + // PermissionBubbleView: |
| + void SetDelegate(Delegate* delegate) override; |
| + void Show(const std::vector<PermissionBubbleRequest*>& requests, |
| + const std::vector<bool>& accept_state, |
| + bool customization_state_) override; |
| + bool CanAcceptRequestUpdate() override; |
| + void Hide() override; |
| + bool IsVisible() override; |
| + |
| + // Wrappers that update the state of the bubble. |
| + void Accept(); |
| + void Deny(); |
| + void Close(); |
| + void Clear(); |
| + |
| + // If we're in a browser test, we need to interact with the message loop. |
| + // But that shouldn't be done in unit tests. |
| + void SetBrowserTest(bool browser_test); |
| + |
| + private: |
| + bool visible_; |
| + bool can_accept_updates_; |
| + Delegate* delegate_; |
| + bool browser_test_; |
| + std::vector<PermissionBubbleRequest*> permission_requests_; |
| + std::vector<bool> permission_states_; |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_VIEW_H_ |