| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_infobar_controller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_infobar_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "chrome/browser/extensions/extension_infobar_delegate.h" | 10 #include "chrome/browser/extensions/extension_infobar_delegate.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 name:NSViewFrameDidChangeNotification | 221 name:NSViewFrameDidChangeNotification |
| 222 object:extensionView_]; | 222 object:extensionView_]; |
| 223 | 223 |
| 224 [[NSNotificationCenter defaultCenter] | 224 [[NSNotificationCenter defaultCenter] |
| 225 addObserver:self | 225 addObserver:self |
| 226 selector:@selector(adjustExtensionViewSize) | 226 selector:@selector(adjustExtensionViewSize) |
| 227 name:NSWindowDidResizeNotification | 227 name:NSWindowDidResizeNotification |
| 228 object:window_]; | 228 object:window_]; |
| 229 } | 229 } |
| 230 | 230 |
| 231 - (void)infobarWillClose { |
| 232 [self disablePopUpMenu:contextMenu_.get()]; |
| 233 [super infobarWillClose]; |
| 234 } |
| 235 |
| 231 - (void)extensionViewFrameChanged { | 236 - (void)extensionViewFrameChanged { |
| 232 [self adjustExtensionViewSize]; | 237 [self adjustExtensionViewSize]; |
| 233 | 238 |
| 234 AnimatableView* view = [self animatableView]; | 239 AnimatableView* view = [self animatableView]; |
| 235 NSRect infoBarFrame = [view frame]; | 240 NSRect infoBarFrame = [view frame]; |
| 236 CGFloat newHeight = [self clampedExtensionViewHeight] + kBottomBorderHeightPx; | 241 CGFloat newHeight = [self clampedExtensionViewHeight] + kBottomBorderHeightPx; |
| 237 [infoBarView_ setPostsFrameChangedNotifications:NO]; | 242 [infoBarView_ setPostsFrameChangedNotifications:NO]; |
| 238 infoBarFrame.size.height = newHeight; | 243 infoBarFrame.size.height = newHeight; |
| 239 [infoBarView_ setFrame:infoBarFrame]; | 244 [infoBarView_ setFrame:infoBarFrame]; |
| 240 [infoBarView_ setPostsFrameChangedNotifications:YES]; | 245 [infoBarView_ setPostsFrameChangedNotifications:YES]; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 263 | 268 |
| 264 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(TabContentsWrapper* owner) { | 269 InfoBar* ExtensionInfoBarDelegate::CreateInfoBar(TabContentsWrapper* owner) { |
| 265 NSWindow* window = | 270 NSWindow* window = |
| 266 [(NSView*)owner->tab_contents()->GetContentNativeView() window]; | 271 [(NSView*)owner->tab_contents()->GetContentNativeView() window]; |
| 267 ExtensionInfoBarController* controller = | 272 ExtensionInfoBarController* controller = |
| 268 [[ExtensionInfoBarController alloc] initWithDelegate:this | 273 [[ExtensionInfoBarController alloc] initWithDelegate:this |
| 269 owner:owner | 274 owner:owner |
| 270 window:window]; | 275 window:window]; |
| 271 return new InfoBar(controller, this); | 276 return new InfoBar(controller, this); |
| 272 } | 277 } |
| OLD | NEW |