| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/cocoa/extensions/extension_popup_controller.h" | 5 #import "chrome/browser/cocoa/extensions/extension_popup_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "chrome/browser/browser.h" | 9 #include "chrome/browser/browser.h" |
| 10 #import "chrome/browser/cocoa/browser_window_cocoa.h" | 10 #import "chrome/browser/cocoa/browser_window_cocoa.h" |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 // We want this to be a child of a browser window. addChildWindow: (called from | 183 // We want this to be a child of a browser window. addChildWindow: (called from |
| 184 // this function) will bring the window on-screen; unfortunately, | 184 // this function) will bring the window on-screen; unfortunately, |
| 185 // [NSWindowController showWindow:] will also bring it on-screen (but will cause | 185 // [NSWindowController showWindow:] will also bring it on-screen (but will cause |
| 186 // unexpected changes to the window's position). We cannot have an | 186 // unexpected changes to the window's position). We cannot have an |
| 187 // addChildWindow: and a subsequent showWindow:. Thus, we have our own version. | 187 // addChildWindow: and a subsequent showWindow:. Thus, we have our own version. |
| 188 - (void)showWindow:(id)sender { | 188 - (void)showWindow:(id)sender { |
| 189 [parentWindow_ addChildWindow:[self window] ordered:NSWindowAbove]; | 189 [parentWindow_ addChildWindow:[self window] ordered:NSWindowAbove]; |
| 190 [[self window] makeKeyAndOrderFront:self]; | 190 [[self window] makeKeyAndOrderFront:self]; |
| 191 } | 191 } |
| 192 | 192 |
| 193 // Private (TestingAPI) |
| 194 - (NSView*)view { |
| 195 return extensionView_; |
| 196 } |
| 197 |
| 198 // Private (TestingAPI) |
| 199 + (NSSize)minPopupSize { |
| 200 NSSize minSize = {kMinWidth, kMinHeight}; |
| 201 return minSize; |
| 202 } |
| 203 |
| 204 // Private (TestingAPI) |
| 205 + (NSSize)maxPopupSize { |
| 206 NSSize maxSize = {kMaxWidth, kMaxHeight}; |
| 207 return maxSize; |
| 208 } |
| 209 |
| 193 @end | 210 @end |
| OLD | NEW |