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

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

Issue 2182883002: Permissions: Rename PermissionBubbleView to PermissionPromptInterface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig@ review Created 4 years, 4 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/bind.h"
8 #include "base/run_loop.h"
9 #include "chrome/browser/permissions/permission_request_manager.h"
10 #include "chrome/browser/ui/website_settings/mock_permission_bubble_factory.h"
11
12 MockPermissionBubbleView::~MockPermissionBubbleView() {
13 Hide();
14 }
15
16 void MockPermissionBubbleView::Show(
17 const std::vector<PermissionRequest*>& requests,
18 const std::vector<bool>& accept_state) {
19 factory_->ShowView(this);
20 factory_->show_count_++;
21 factory_->requests_count_ = manager_->requests_.size();
22 factory_->total_requests_count_ += manager_->requests_.size();
23 factory_->UpdateResponseType();
24 is_visible_ = true;
25 }
26
27 bool MockPermissionBubbleView::CanAcceptRequestUpdate() {
28 return can_update_ui_;
29 }
30
31 void MockPermissionBubbleView::Hide() {
32 if (is_visible_ && factory_)
33 factory_->HideView(this);
34 is_visible_ = false;
35 }
36
37 bool MockPermissionBubbleView::IsVisible() {
38 return is_visible_;
39 }
40
41 void MockPermissionBubbleView::UpdateAnchorPosition() {}
42
43 gfx::NativeWindow MockPermissionBubbleView::GetNativeWindow() {
44 // This class should only be used when the UI is not necessary.
45 NOTREACHED();
46 return nullptr;
47 }
48
49 MockPermissionBubbleView::MockPermissionBubbleView(
50 MockPermissionBubbleFactory* factory,
51 PermissionRequestManager* manager)
52 : factory_(factory),
53 manager_(manager),
54 can_update_ui_(true),
55 is_visible_(false) {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698