OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "extension_installed_bubble_controller.h" | 5 #import "extension_installed_bubble_controller.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 // We want this to be a child of a browser window. addChildWindow: | 197 // We want this to be a child of a browser window. addChildWindow: |
198 // (called from this function) will bring the window on-screen; | 198 // (called from this function) will bring the window on-screen; |
199 // unfortunately, [NSWindowController showWindow:] will also bring it | 199 // unfortunately, [NSWindowController showWindow:] will also bring it |
200 // on-screen (but will cause unexpected changes to the window's | 200 // on-screen (but will cause unexpected changes to the window's |
201 // position). We cannot have an addChildWindow: and a subsequent | 201 // position). We cannot have an addChildWindow: and a subsequent |
202 // showWindow:. Thus, we have our own version. | 202 // showWindow:. Thus, we have our own version. |
203 - (void)showWindow:(id)sender { | 203 - (void)showWindow:(id)sender { |
204 // Generic extensions get an infobar rather than a bubble. | 204 // Generic extensions get an infobar rather than a bubble. |
205 DCHECK(type_ != extension_installed_bubble::kGeneric); | 205 DCHECK(type_ != extension_installed_bubble::kGeneric); |
206 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI)); | 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
207 | 207 |
208 // Load nib and calculate height based on messages to be shown. | 208 // Load nib and calculate height based on messages to be shown. |
209 NSWindow* window = [self initializeWindow]; | 209 NSWindow* window = [self initializeWindow]; |
210 int newWindowHeight = [self calculateWindowHeight]; | 210 int newWindowHeight = [self calculateWindowHeight]; |
211 [infoBubbleView_ setFrameSize:NSMakeSize( | 211 [infoBubbleView_ setFrameSize:NSMakeSize( |
212 NSWidth([[window contentView] bounds]), newWindowHeight)]; | 212 NSWidth([[window contentView] bounds]), newWindowHeight)]; |
213 NSSize windowDelta = NSMakeSize( | 213 NSSize windowDelta = NSMakeSize( |
214 0, newWindowHeight - NSHeight([[window contentView] bounds])); | 214 0, newWindowHeight - NSHeight([[window contentView] bounds])); |
215 windowDelta = [[window contentView] convertSize:windowDelta toView:nil]; | 215 windowDelta = [[window contentView] convertSize:windowDelta toView:nil]; |
216 NSRect newFrame = [window frame]; | 216 NSRect newFrame = [window frame]; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 323 |
324 - (NSRect)getPageActionInfoMsgFrame { | 324 - (NSRect)getPageActionInfoMsgFrame { |
325 return [pageActionInfoMsg_ frame]; | 325 return [pageActionInfoMsg_ frame]; |
326 } | 326 } |
327 | 327 |
328 - (NSRect)getExtensionInstalledInfoMsgFrame { | 328 - (NSRect)getExtensionInstalledInfoMsgFrame { |
329 return [extensionInstalledInfoMsg_ frame]; | 329 return [extensionInstalledInfoMsg_ frame]; |
330 } | 330 } |
331 | 331 |
332 @end | 332 @end |
OLD | NEW |