| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chooser_bubble_ui_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/website_settings/chooser_bubble_ui_cocoa.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 base::scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] | 98 base::scoped_nsobject<InfoBubbleWindow> window([[InfoBubbleWindow alloc] |
| 99 initWithContentRect:ui::kWindowSizeDeterminedLater | 99 initWithContentRect:ui::kWindowSizeDeterminedLater |
| 100 styleMask:NSBorderlessWindowMask | 100 styleMask:NSBorderlessWindowMask |
| 101 backing:NSBackingStoreBuffered | 101 backing:NSBackingStoreBuffered |
| 102 defer:NO]); | 102 defer:NO]); |
| 103 [window setAllowedAnimations:info_bubble::kAnimateNone]; | 103 [window setAllowedAnimations:info_bubble::kAnimateNone]; |
| 104 [window setReleasedWhenClosed:NO]; | 104 [window setReleasedWhenClosed:NO]; |
| 105 if ((self = [super initWithWindow:window | 105 if ((self = [super initWithWindow:window |
| 106 parentWindow:[self getExpectedParentWindow] | 106 parentWindow:[self getExpectedParentWindow] |
| 107 anchoredAt:NSZeroPoint])) { | 107 anchoredAt:NSZeroPoint])) { |
| 108 [self setShouldCloseOnResignKey:NO]; | 108 [self setShouldCloseOnResignKey:YES]; |
| 109 [self setShouldOpenAsKeyWindow:YES]; | 109 [self setShouldOpenAsKeyWindow:YES]; |
| 110 [[self bubble] setArrowLocation:[self getExpectedArrowLocation]]; | 110 [[self bubble] setArrowLocation:[self getExpectedArrowLocation]]; |
| 111 bridge_ = bridge; | 111 bridge_ = bridge; |
| 112 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; | 112 NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; |
| 113 [center addObserver:self | 113 [center addObserver:self |
| 114 selector:@selector(parentWindowDidMove:) | 114 selector:@selector(parentWindowDidMove:) |
| 115 name:NSWindowDidMoveNotification | 115 name:NSWindowDidMoveNotification |
| 116 object:[self getExpectedParentWindow]]; | 116 object:[self getExpectedParentWindow]]; |
| 117 | 117 |
| 118 base::string16 chooserTitle = chooserController->GetTitle(); | 118 base::string16 chooserTitle = chooserController->GetTitle(); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 void ChooserBubbleUiCocoa::UpdateAnchorPosition() { | 317 void ChooserBubbleUiCocoa::UpdateAnchorPosition() { |
| 318 if (chooser_bubble_ui_controller_) | 318 if (chooser_bubble_ui_controller_) |
| 319 [chooser_bubble_ui_controller_ updateAnchorPosition]; | 319 [chooser_bubble_ui_controller_ updateAnchorPosition]; |
| 320 } | 320 } |
| 321 | 321 |
| 322 void ChooserBubbleUiCocoa::OnBubbleClosing() { | 322 void ChooserBubbleUiCocoa::OnBubbleClosing() { |
| 323 chooser_bubble_ui_controller_ = nil; | 323 chooser_bubble_ui_controller_ = nil; |
| 324 } | 324 } |
| OLD | NEW |