OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/views/permission_bubble/permission_prompt_impl.h" | 5 #include "chrome/browser/ui/views/permission_bubble/permission_prompt_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); | 419 GetLayoutConstant(LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET), 0)); |
420 | 420 |
421 views::BubbleDialogDelegateView::CreateBubble(bubble_delegate_)->Show(); | 421 views::BubbleDialogDelegateView::CreateBubble(bubble_delegate_)->Show(); |
422 bubble_delegate_->SizeToContents(); | 422 bubble_delegate_->SizeToContents(); |
423 | 423 |
424 bubble_delegate_->UpdateAnchor(GetAnchorView(), | 424 bubble_delegate_->UpdateAnchor(GetAnchorView(), |
425 GetAnchorPoint(), | 425 GetAnchorPoint(), |
426 GetAnchorArrow()); | 426 GetAnchorArrow()); |
427 } | 427 } |
428 | 428 |
429 bool PermissionPromptImpl::CanAcceptRequestUpdate() { | 429 bool PermissionPromptImpl::MaybeCancelRequest() { |
430 return !(bubble_delegate_ && bubble_delegate_->IsMouseHovered()); | 430 if (bubble_delegate_->IsMouseHovered()) |
| 431 return false; |
| 432 Hide(); |
| 433 return true; |
431 } | 434 } |
432 | 435 |
433 bool PermissionPromptImpl::HidesAutomatically() { | 436 bool PermissionPromptImpl::HidesAutomatically() { |
434 return false; | 437 return false; |
435 } | 438 } |
436 | 439 |
437 void PermissionPromptImpl::Hide() { | 440 void PermissionPromptImpl::Hide() { |
438 if (bubble_delegate_) { | 441 if (bubble_delegate_) { |
439 bubble_delegate_->CloseBubble(); | 442 bubble_delegate_->CloseBubble(); |
440 bubble_delegate_ = nullptr; | 443 bubble_delegate_ = nullptr; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 } | 486 } |
484 | 487 |
485 void PermissionPromptImpl::Deny() { | 488 void PermissionPromptImpl::Deny() { |
486 if (delegate_) | 489 if (delegate_) |
487 delegate_->Deny(); | 490 delegate_->Deny(); |
488 } | 491 } |
489 | 492 |
490 Profile* PermissionPromptImpl::GetProfile() { | 493 Profile* PermissionPromptImpl::GetProfile() { |
491 return browser_->profile(); | 494 return browser_->profile(); |
492 } | 495 } |
OLD | NEW |