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.
5 #include "chrome/browser/ui/website_settings/mock_permission_bubble_view.h"
7 #include "base/run_loop.h"
9 MockPermissionBubbleView::MockPermissionBubbleView()
11 can_accept_updates_(true),
13 browser_test_(false) {}
15 MockPermissionBubbleView::~MockPermissionBubbleView() {}
17 void MockPermissionBubbleView::SetDelegate(Delegate
* delegate
) {
21 void MockPermissionBubbleView::Show(
22 const std::vector
<PermissionBubbleRequest
*>& requests
,
23 const std::vector
<bool>& accept_state
) {
25 permission_requests_
= requests
;
26 permission_states_
= accept_state
;
28 base::MessageLoopForUI::current()->Quit();
31 void MockPermissionBubbleView::Hide() {
35 bool MockPermissionBubbleView::IsVisible() {
39 bool MockPermissionBubbleView::CanAcceptRequestUpdate() {
40 return can_accept_updates_
;
43 void MockPermissionBubbleView::Accept() {
47 void MockPermissionBubbleView::Deny() {
51 void MockPermissionBubbleView::Close() {
55 void MockPermissionBubbleView::Clear() {
57 can_accept_updates_
= true;
59 permission_requests_
.clear();
60 permission_states_
.clear();
63 void MockPermissionBubbleView::SetBrowserTest(bool browser_test
) {
64 browser_test_
= browser_test
;