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

Side by Side Diff: chrome/browser/ui/website_settings/mock_permission_bubble_view.cc

Issue 787033004: Update geolocation permission tests for the permission bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Exclude flaky browsertests Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(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 #include "chrome/browser/ui/website_settings/mock_permission_bubble_view.h"
6
7 #include "base/run_loop.h"
8
9 MockPermissionBubbleView::MockPermissionBubbleView()
10 : visible_(false),
11 can_accept_updates_(true),
12 delegate_(nullptr),
13 browser_test_(false) {}
14
15 MockPermissionBubbleView::~MockPermissionBubbleView() {}
16
17 void MockPermissionBubbleView::SetDelegate(Delegate* delegate) {
18 delegate_ = delegate;
19 }
20
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();
29 }
30
31 void MockPermissionBubbleView::Hide() {
32 visible_ = false;
33 }
34
35 bool MockPermissionBubbleView::IsVisible() {
36 return visible_;
37 }
38
39 bool MockPermissionBubbleView::CanAcceptRequestUpdate() {
40 return can_accept_updates_;
41 }
42
43 void MockPermissionBubbleView::Accept() {
44 delegate_->Accept();
45 }
46
47 void MockPermissionBubbleView::Deny() {
48 delegate_->Deny();
49 }
50
51 void MockPermissionBubbleView::Close() {
52 delegate_->Closing();
53 }
54
55 void MockPermissionBubbleView::Clear() {
56 visible_ = false;
57 can_accept_updates_ = true;
58 delegate_ = nullptr;
59 permission_requests_.clear();
60 permission_states_.clear();
61 }
62
63 void MockPermissionBubbleView::SetBrowserTest(bool browser_test) {
64 browser_test_ = browser_test;
65 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698