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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 styleMask:NSBorderlessWindowMask | 227 styleMask:NSBorderlessWindowMask |
228 backing:NSBackingStoreBuffered | 228 backing:NSBackingStoreBuffered |
229 defer:NO]); | 229 defer:NO]); |
230 [window setAllowedAnimations:info_bubble::kAnimateNone]; | 230 [window setAllowedAnimations:info_bubble::kAnimateNone]; |
231 [window setReleasedWhenClosed:NO]; | 231 [window setReleasedWhenClosed:NO]; |
232 if ((self = [super initWithWindow:window | 232 if ((self = [super initWithWindow:window |
233 parentWindow:parentWindow | 233 parentWindow:parentWindow |
234 anchoredAt:NSZeroPoint])) { | 234 anchoredAt:NSZeroPoint])) { |
235 [self setShouldCloseOnResignKey:NO]; | 235 [self setShouldCloseOnResignKey:NO]; |
236 [self setShouldOpenAsKeyWindow:YES]; | 236 [self setShouldOpenAsKeyWindow:YES]; |
237 [[self bubble] setArrowLocation:info_bubble::kTopLeft]; | 237 [[self bubble] setArrowLocation:bridge->GetArrowLocation()]; |
238 bridge_ = bridge; | 238 bridge_ = bridge; |
239 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; | 239 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
240 [center addObserver:self | 240 [center addObserver:self |
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 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 | 569 |
570 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { | 570 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { |
571 NSRect frameA = [viewA frame]; | 571 NSRect frameA = [viewA frame]; |
572 NSRect frameB = [viewB frame]; | 572 NSRect frameB = [viewB frame]; |
573 frameA.origin.y = | 573 frameA.origin.y = |
574 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); | 574 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); |
575 [viewA setFrameOrigin:frameA.origin]; | 575 [viewA setFrameOrigin:frameA.origin]; |
576 } | 576 } |
577 | 577 |
578 @end // implementation PermissionBubbleController | 578 @end // implementation PermissionBubbleController |
OLD | NEW |