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

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

Issue 902643003: Revert of Update geolocation permission tests for the permission bubble (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 bool customization_state_) {
25 visible_ = true;
26 permission_requests_ = requests;
27 permission_states_ = accept_state;
28 if (browser_test_)
29 base::MessageLoopForUI::current()->Quit();
30 }
31
32 void MockPermissionBubbleView::Hide() {
33 visible_ = false;
34 }
35
36 bool MockPermissionBubbleView::IsVisible() {
37 return visible_;
38 }
39
40 bool MockPermissionBubbleView::CanAcceptRequestUpdate() {
41 return can_accept_updates_;
42 }
43
44 void MockPermissionBubbleView::Accept() {
45 delegate_->Accept();
46 }
47
48 void MockPermissionBubbleView::Deny() {
49 delegate_->Deny();
50 }
51
52 void MockPermissionBubbleView::Close() {
53 delegate_->Closing();
54 }
55
56 void MockPermissionBubbleView::Clear() {
57 visible_ = false;
58 can_accept_updates_ = true;
59 delegate_ = nullptr;
60 permission_requests_.clear();
61 permission_states_.clear();
62 }
63
64 void MockPermissionBubbleView::SetBrowserTest(bool browser_test) {
65 browser_test_ = browser_test;
66 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698