| 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 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
" | 5 #import "chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.h
" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/mac/bind_objc_block.h" | 9 #include "base/mac/bind_objc_block.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 selector:@selector(parentWindowDidMove:) | 241 selector:@selector(parentWindowDidMove:) |
| 242 name:NSWindowDidMoveNotification | 242 name:NSWindowDidMoveNotification |
| 243 object:parentWindow]; | 243 object:parentWindow]; |
| 244 } | 244 } |
| 245 return self; | 245 return self; |
| 246 } | 246 } |
| 247 | 247 |
| 248 - (void)windowWillClose:(NSNotification*)notification { | 248 - (void)windowWillClose:(NSNotification*)notification { |
| 249 bridge_->OnBubbleClosing(); | 249 bridge_->OnBubbleClosing(); |
| 250 [super windowWillClose:notification]; | 250 [super windowWillClose:notification]; |
| 251 |
| 252 if (delegate_) |
| 253 delegate_->Closing(); |
| 251 } | 254 } |
| 252 | 255 |
| 253 - (void)parentWindowWillBecomeFullScreen:(NSNotification*)notification { | 256 - (void)parentWindowWillBecomeFullScreen:(NSNotification*)notification { |
| 254 // Override the base class implementation, which would have closed the bubble. | 257 // Override the base class implementation, which would have closed the bubble. |
| 255 } | 258 } |
| 256 | 259 |
| 257 - (void)parentWindowDidResize:(NSNotification*)notification { | 260 - (void)parentWindowDidResize:(NSNotification*)notification { |
| 258 DCHECK(bridge_); | 261 DCHECK(bridge_); |
| 259 [self setAnchorPoint:bridge_->GetAnchorPoint()]; | 262 [self setAnchorPoint:bridge_->GetAnchorPoint()]; |
| 260 } | 263 } |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 | 572 |
| 570 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { | 573 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { |
| 571 NSRect frameA = [viewA frame]; | 574 NSRect frameA = [viewA frame]; |
| 572 NSRect frameB = [viewB frame]; | 575 NSRect frameB = [viewB frame]; |
| 573 frameA.origin.y = | 576 frameA.origin.y = |
| 574 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); | 577 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); |
| 575 [viewA setFrameOrigin:frameA.origin]; | 578 [viewA setFrameOrigin:frameA.origin]; |
| 576 } | 579 } |
| 577 | 580 |
| 578 @end // implementation PermissionBubbleController | 581 @end // implementation PermissionBubbleController |
| OLD | NEW |