diff options
Diffstat (limited to 'chrome/browser/ui')
-rw-r--r-- | chrome/browser/ui/website_settings/permission_bubble_manager.cc | 7 | ||||
-rw-r--r-- | chrome/browser/ui/website_settings/permission_bubble_manager_unittest.cc | 19 |
2 files changed, 21 insertions, 5 deletions
diff --git a/chrome/browser/ui/website_settings/permission_bubble_manager.cc b/chrome/browser/ui/website_settings/permission_bubble_manager.cc index c6d4141a..97864dd 100644 --- a/chrome/browser/ui/website_settings/permission_bubble_manager.cc +++ b/chrome/browser/ui/website_settings/permission_bubble_manager.cc @@ -168,17 +168,15 @@ void PermissionBubbleManager::Closing() { void PermissionBubbleManager::ShowBubble() { if (view_ && !bubble_showing_ && requests_.size()) { - view_->SetDelegate(this); view_->Show(requests_, accept_states_, customization_mode_); bubble_showing_ = true; } } void PermissionBubbleManager::FinalizeBubble() { - if (view_) { - view_->SetDelegate(NULL); + if (view_) view_->Hide(); - } + bubble_showing_ = false; std::vector<PermissionBubbleRequest*>::iterator requests_iter; for (requests_iter = requests_.begin(); @@ -188,7 +186,6 @@ void PermissionBubbleManager::FinalizeBubble() { } requests_.clear(); accept_states_.clear(); - bubble_showing_ = false; if (queued_requests_.size()) { requests_ = queued_requests_; accept_states_.resize(requests_.size(), true); diff --git a/chrome/browser/ui/website_settings/permission_bubble_manager_unittest.cc b/chrome/browser/ui/website_settings/permission_bubble_manager_unittest.cc index fcbc57b..3e5a1c1 100644 --- a/chrome/browser/ui/website_settings/permission_bubble_manager_unittest.cc +++ b/chrome/browser/ui/website_settings/permission_bubble_manager_unittest.cc @@ -283,3 +283,22 @@ TEST_F(PermissionBubbleManagerTest, TestAddDuplicateRequest) { EXPECT_EQ(&request1_, view_.permission_requests_[0]); EXPECT_EQ(&request2_, view_.permission_requests_[1]); } + +TEST_F(PermissionBubbleManagerTest, SequentialRequests) { + manager_->SetView(&view_); + manager_->AddRequest(&request1_); + WaitForCoalescing(); + EXPECT_TRUE(view_.shown_); + + Accept(); + EXPECT_TRUE(request1_.granted_); + + EXPECT_FALSE(view_.shown_); + + manager_->AddRequest(&request2_); + WaitForCoalescing(); + EXPECT_TRUE(view_.shown_); + Accept(); + EXPECT_FALSE(view_.shown_); + EXPECT_TRUE(request2_.granted_); +} |