| 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/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 Loading... |
| 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 } |
| OLD | NEW |