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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 styleMask:NSBorderlessWindowMask | 223 styleMask:NSBorderlessWindowMask |
224 backing:NSBackingStoreBuffered | 224 backing:NSBackingStoreBuffered |
225 defer:NO]); | 225 defer:NO]); |
226 [window setAllowedAnimations:info_bubble::kAnimateNone]; | 226 [window setAllowedAnimations:info_bubble::kAnimateNone]; |
227 [window setReleasedWhenClosed:NO]; | 227 [window setReleasedWhenClosed:NO]; |
228 if ((self = [super initWithWindow:window | 228 if ((self = [super initWithWindow:window |
229 parentWindow:parentWindow | 229 parentWindow:parentWindow |
230 anchoredAt:NSZeroPoint])) { | 230 anchoredAt:NSZeroPoint])) { |
231 [self setShouldCloseOnResignKey:NO]; | 231 [self setShouldCloseOnResignKey:NO]; |
232 [self setShouldOpenAsKeyWindow:NO]; | 232 [self setShouldOpenAsKeyWindow:NO]; |
233 [[self bubble] setArrowLocation:info_bubble::kTopLeft]; | 233 [[self bubble] setArrowLocation:bridge->GetArrowLocation()]; |
234 bridge_ = bridge; | 234 bridge_ = bridge; |
235 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; | 235 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
236 [center addObserver:self | 236 [center addObserver:self |
237 selector:@selector(parentWindowDidMove:) | 237 selector:@selector(parentWindowDidMove:) |
238 name:NSWindowDidMoveNotification | 238 name:NSWindowDidMoveNotification |
239 object:parentWindow]; | 239 object:parentWindow]; |
240 } | 240 } |
241 return self; | 241 return self; |
242 } | 242 } |
243 | 243 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 563 |
564 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { | 564 + (void)alignCenterOf:(NSView*)viewA verticallyToCenterOf:(NSView*)viewB { |
565 NSRect frameA = [viewA frame]; | 565 NSRect frameA = [viewA frame]; |
566 NSRect frameB = [viewB frame]; | 566 NSRect frameB = [viewB frame]; |
567 frameA.origin.y = | 567 frameA.origin.y = |
568 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); | 568 NSMinY(frameB) + std::floor((NSHeight(frameB) - NSHeight(frameA)) / 2); |
569 [viewA setFrameOrigin:frameA.origin]; | 569 [viewA setFrameOrigin:frameA.origin]; |
570 } | 570 } |
571 | 571 |
572 @end // implementation PermissionBubbleController | 572 @end // implementation PermissionBubbleController |
OLD | NEW |