| 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 if (browser_test_) | 26 if (browser_test_) |
| 27 base::MessageLoopForUI::current()->QuitWhenIdle(); | 27 base::MessageLoopForUI::current()->QuitWhenIdle(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 51 | 51 |
| 52 MockPermissionBubbleView::MockPermissionBubbleView( | 52 MockPermissionBubbleView::MockPermissionBubbleView( |
| 53 MockPermissionBubbleFactory* factory, | 53 MockPermissionBubbleFactory* factory, |
| 54 PermissionRequestManager* manager, | 54 PermissionRequestManager* manager, |
| 55 bool browser_test) | 55 bool browser_test) |
| 56 : factory_(factory), | 56 : factory_(factory), |
| 57 manager_(manager), | 57 manager_(manager), |
| 58 browser_test_(browser_test), | 58 browser_test_(browser_test), |
| 59 can_update_ui_(true), | 59 can_update_ui_(true), |
| 60 is_visible_(false) {} | 60 is_visible_(false) {} |
| OLD | NEW |