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

Side by Side Diff: chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.mm

Issue 2853803002: Make PermissionRequestManager::requests_ correspond to the active prompt (Closed)
Patch Set: fix it? :D 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/cocoa/permission_bubble/permission_bubble_cocoa.h" 5 #include "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" 8 #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
9 #import "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller. h" 9 #import "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_controller. h"
10 #import "chrome/browser/ui/permission_bubble/permission_prompt.h" 10 #import "chrome/browser/ui/permission_bubble/permission_prompt.h"
(...skipping 19 matching lines...) Expand all
30 30
31 [bubbleController_ showWithDelegate:delegate_ 31 [bubbleController_ showWithDelegate:delegate_
32 forRequests:requests 32 forRequests:requests
33 acceptStates:accept_state]; 33 acceptStates:accept_state];
34 } 34 }
35 35
36 void PermissionBubbleCocoa::Hide() { 36 void PermissionBubbleCocoa::Hide() {
37 [bubbleController_ close]; 37 [bubbleController_ close];
38 } 38 }
39 39
40 bool PermissionBubbleCocoa::IsVisible() {
41 return bubbleController_ != nil;
42 }
43
44 void PermissionBubbleCocoa::SetDelegate(Delegate* delegate) { 40 void PermissionBubbleCocoa::SetDelegate(Delegate* delegate) {
45 if (delegate_ == delegate) 41 if (delegate_ == delegate)
46 return; 42 return;
47 delegate_ = delegate; 43 delegate_ = delegate;
48 } 44 }
49 45
50 bool PermissionBubbleCocoa::CanAcceptRequestUpdate() { 46 bool PermissionBubbleCocoa::CanAcceptRequestUpdate() {
51 return ![[[bubbleController_ window] contentView] cr_isMouseInView]; 47 return ![[[bubbleController_ window] contentView] cr_isMouseInView];
52 } 48 }
53 49
54 bool PermissionBubbleCocoa::HidesAutomatically() { 50 bool PermissionBubbleCocoa::HidesAutomatically() {
55 return false; 51 return false;
56 } 52 }
57 53
58 void PermissionBubbleCocoa::UpdateAnchorPosition() { 54 void PermissionBubbleCocoa::UpdateAnchorPosition() {
59 [bubbleController_ updateAnchorPosition]; 55 [bubbleController_ updateAnchorPosition];
60 } 56 }
61 57
62 gfx::NativeWindow PermissionBubbleCocoa::GetNativeWindow() { 58 gfx::NativeWindow PermissionBubbleCocoa::GetNativeWindow() {
63 return [bubbleController_ window]; 59 return [bubbleController_ window];
64 } 60 }
65 61
66 void PermissionBubbleCocoa::OnBubbleClosing() { 62 void PermissionBubbleCocoa::OnBubbleClosing() {
67 bubbleController_ = nil; 63 bubbleController_ = nil;
68 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698