Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / website_settings / mock_permission_bubble_view.cc
blob69170f4fefc915886ea26751d21e12ef0a1d93ac
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()
10 : visible_(false),
11 can_accept_updates_(true),
12 delegate_(nullptr),
13 browser_test_(false) {}
15 MockPermissionBubbleView::~MockPermissionBubbleView() {}
17 void MockPermissionBubbleView::SetDelegate(Delegate* delegate) {
18 delegate_ = delegate;
21 void MockPermissionBubbleView::Show(
22 const std::vector<PermissionBubbleRequest*>& requests,
23 const std::vector<bool>& accept_state) {
24 visible_ = true;
25 permission_requests_ = requests;
26 permission_states_ = accept_state;
27 if (browser_test_)
28 base::MessageLoopForUI::current()->Quit();
31 void MockPermissionBubbleView::Hide() {
32 visible_ = false;
35 bool MockPermissionBubbleView::IsVisible() {
36 return visible_;
39 bool MockPermissionBubbleView::CanAcceptRequestUpdate() {
40 return can_accept_updates_;
43 void MockPermissionBubbleView::Accept() {
44 delegate_->Accept();
47 void MockPermissionBubbleView::Deny() {
48 delegate_->Deny();
51 void MockPermissionBubbleView::Close() {
52 delegate_->Closing();
55 void MockPermissionBubbleView::Clear() {
56 visible_ = false;
57 can_accept_updates_ = true;
58 delegate_ = nullptr;
59 permission_requests_.clear();
60 permission_states_.clear();
63 void MockPermissionBubbleView::SetBrowserTest(bool browser_test) {
64 browser_test_ = browser_test;