| 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/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 [[PermissionBubbleWindow alloc] | 211 [[PermissionBubbleWindow alloc] |
| 212 initWithContentRect:ui::kWindowSizeDeterminedLater | 212 initWithContentRect:ui::kWindowSizeDeterminedLater |
| 213 styleMask:NSBorderlessWindowMask | 213 styleMask:NSBorderlessWindowMask |
| 214 backing:NSBackingStoreBuffered | 214 backing:NSBackingStoreBuffered |
| 215 defer:NO]); | 215 defer:NO]); |
| 216 [window setAllowedAnimations:info_bubble::kAnimateNone]; | 216 [window setAllowedAnimations:info_bubble::kAnimateNone]; |
| 217 if ((self = [super initWithWindow:window | 217 if ((self = [super initWithWindow:window |
| 218 parentWindow:parentWindow | 218 parentWindow:parentWindow |
| 219 anchoredAt:NSZeroPoint])) { | 219 anchoredAt:NSZeroPoint])) { |
| 220 [self setShouldCloseOnResignKey:NO]; | 220 [self setShouldCloseOnResignKey:NO]; |
| 221 [self setShouldOpenAsKeyWindow:NO]; |
| 221 [[self bubble] setArrowLocation:info_bubble::kTopLeft]; | 222 [[self bubble] setArrowLocation:info_bubble::kTopLeft]; |
| 222 bridge_ = bridge; | 223 bridge_ = bridge; |
| 223 } | 224 } |
| 224 return self; | 225 return self; |
| 225 } | 226 } |
| 226 | 227 |
| 227 - (void)windowWillClose:(NSNotification*)notification { | 228 - (void)windowWillClose:(NSNotification*)notification { |
| 228 bridge_->OnBubbleClosing(); | 229 bridge_->OnBubbleClosing(); |
| 229 [super windowWillClose:notification]; | 230 [super windowWillClose:notification]; |
| 230 } | 231 } |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 | 543 |
| 543 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { | 544 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { |
| 544 NSRect frameA = [viewA frame]; | 545 NSRect frameA = [viewA frame]; |
| 545 NSRect frameB = [viewB frame]; | 546 NSRect frameB = [viewB frame]; |
| 546 frameA.origin.y = | 547 frameA.origin.y = |
| 547 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); | 548 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); |
| 548 [viewA setFrameOrigin:frameA.origin]; | 549 [viewA setFrameOrigin:frameA.origin]; |
| 549 } | 550 } |
| 550 | 551 |
| 551 @end // implementation PermissionBubbleController | 552 @end // implementation PermissionBubbleController |
| OLD | NEW |