| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/website_settings/mock_permission_bubble_view.h" | 5 #include "chrome/browser/ui/website_settings/mock_permission_bubble_view.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "chrome/browser/permissions/permission_request_manager.h" | 9 #include "chrome/browser/permissions/permission_request_manager.h" |
| 10 #include "chrome/browser/ui/website_settings/mock_permission_bubble_factory.h" | 10 #include "chrome/browser/ui/website_settings/mock_permission_bubble_factory.h" |
| 11 | 11 |
| 12 MockPermissionBubbleView::~MockPermissionBubbleView() { | 12 MockPermissionBubbleView::~MockPermissionBubbleView() { |
| 13 Hide(); | 13 Hide(); |
| 14 } | 14 } |
| 15 | 15 |
| 16 void MockPermissionBubbleView::Show( | 16 void MockPermissionBubbleView::Show( |
| 17 const std::vector<PermissionBubbleRequest*>& requests, | 17 const std::vector<PermissionRequest*>& requests, |
| 18 const std::vector<bool>& accept_state) { | 18 const std::vector<bool>& accept_state) { |
| 19 factory_->ShowView(this); | 19 factory_->ShowView(this); |
| 20 factory_->show_count_++; | 20 factory_->show_count_++; |
| 21 factory_->requests_count_ = manager_->requests_.size(); | 21 factory_->requests_count_ = manager_->requests_.size(); |
| 22 factory_->total_requests_count_ += manager_->requests_.size(); | 22 factory_->total_requests_count_ += manager_->requests_.size(); |
| 23 factory_->UpdateResponseType(); | 23 factory_->UpdateResponseType(); |
| 24 is_visible_ = true; | 24 is_visible_ = true; |
| 25 } | 25 } |
| 26 | 26 |
| 27 bool MockPermissionBubbleView::CanAcceptRequestUpdate() { | 27 bool MockPermissionBubbleView::CanAcceptRequestUpdate() { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 46 return nullptr; | 46 return nullptr; |
| 47 } | 47 } |
| 48 | 48 |
| 49 MockPermissionBubbleView::MockPermissionBubbleView( | 49 MockPermissionBubbleView::MockPermissionBubbleView( |
| 50 MockPermissionBubbleFactory* factory, | 50 MockPermissionBubbleFactory* factory, |
| 51 PermissionRequestManager* manager) | 51 PermissionRequestManager* manager) |
| 52 : factory_(factory), | 52 : factory_(factory), |
| 53 manager_(manager), | 53 manager_(manager), |
| 54 can_update_ui_(true), | 54 can_update_ui_(true), |
| 55 is_visible_(false) {} | 55 is_visible_(false) {} |
| OLD | NEW |