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

Side by Side Diff: chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc

Issue 2829023002: Fix cancelling permission requests on Android when the PermissionRequestManager is enabled (Closed)
Patch Set: rebase Created 3 years, 7 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
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698