| Index: chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm
|
| index 8da7fb1aa5d4aa0059326fa58c1140be8aa2399c..af6437117ebd19c1671d313c5922380e0433c1dd 100644
|
| --- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.mm
|
| @@ -4,64 +4,51 @@
|
|
|
| #include "chrome/browser/ui/cocoa/website_settings/permission_bubble_cocoa.h"
|
|
|
| +#include "chrome/browser/ui/browser_finder.h"
|
| #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
|
| #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h"
|
| -#import "chrome/browser/ui/website_settings/permission_bubble_view.h"
|
| +#import "chrome/browser/ui/website_settings/permission_bubble_delegate.h"
|
| +#import "chrome/browser/ui/website_settings/permission_bubble_manager.h"
|
| #include "content/public/browser/web_contents.h"
|
| #import "ui/base/cocoa/nsview_additions.h"
|
|
|
| -PermissionBubbleCocoa::PermissionBubbleCocoa(Browser* browser)
|
| - : browser_(browser), delegate_(nullptr), bubbleController_(nil) {
|
| - DCHECK(browser);
|
| +PermissionBubbleCocoa::PermissionBubbleCocoa(PermissionBubbleManager* manager)
|
| + : manager_(manager), bubbleController_(nil) {
|
| + DCHECK(manager_);
|
| }
|
|
|
| PermissionBubbleCocoa::~PermissionBubbleCocoa() {
|
| }
|
|
|
| // static
|
| -scoped_ptr<PermissionBubbleView> PermissionBubbleView::Create(
|
| - Browser* browser) {
|
| - return make_scoped_ptr(new PermissionBubbleCocoa(browser));
|
| +scoped_ptr<BubbleUI> PermissionBubbleDelegate::CreateBubble(
|
| + PermissionBubbleManager* manager) {
|
| + return make_scoped_ptr(new PermissionBubbleCocoa(manager));
|
| }
|
|
|
| -void PermissionBubbleCocoa::Show(
|
| - const std::vector<PermissionBubbleRequest*>& requests,
|
| - const std::vector<bool>& accept_state) {
|
| +void PermissionBubbleCocoa::Show() {
|
| if (!bubbleController_) {
|
| - bubbleController_ =
|
| - [[PermissionBubbleController alloc] initWithBrowser:browser_
|
| - bridge:this];
|
| + bubbleController_ = [[PermissionBubbleController alloc]
|
| + initWithBrowser:chrome::FindBrowserWithWebContents(
|
| + manager_->web_contents())
|
| + bridge:this];
|
| }
|
|
|
| - [bubbleController_ showWithDelegate:delegate_
|
| - forRequests:requests
|
| - acceptStates:accept_state];
|
| + [bubbleController_ showWithManager:manager_
|
| + forRequests:manager_->requests()
|
| + acceptStates:manager_->accept_states()];
|
| }
|
|
|
| void PermissionBubbleCocoa::Hide() {
|
| [bubbleController_ close];
|
| }
|
|
|
| -bool PermissionBubbleCocoa::IsVisible() {
|
| - return bubbleController_ != nil;
|
| -}
|
| -
|
| -void PermissionBubbleCocoa::SetDelegate(Delegate* delegate) {
|
| - if (delegate_ == delegate)
|
| - return;
|
| - delegate_ = delegate;
|
| -}
|
| -
|
| -bool PermissionBubbleCocoa::CanAcceptRequestUpdate() {
|
| - return ![[[bubbleController_ window] contentView] cr_isMouseInView];
|
| -}
|
| -
|
| void PermissionBubbleCocoa::UpdateAnchorPosition() {
|
| [bubbleController_ updateAnchorPosition];
|
| }
|
|
|
| -gfx::NativeWindow PermissionBubbleCocoa::GetNativeWindow() {
|
| - return [bubbleController_ window];
|
| +bool PermissionBubbleCocoa::CanAcceptUpdate() const {
|
| + return ![[[bubbleController_ window] contentView] cr_isMouseInView];
|
| }
|
|
|
| void PermissionBubbleCocoa::OnBubbleClosing() {
|
|
|