Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controller.mm

Issue 9703084: [Mac] Make BookmarkBubbleController is-a BaseBubbleController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_installed_bubble_controlle r.h" 5 #import "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controlle r.h"
6 6
7 #include "base/i18n/rtl.h" 7 #include "base/i18n/rtl.h"
8 #include "base/mac/bundle_locations.h" 8 #include "base/mac/bundle_locations.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 arrowPoint = [wrenchButton convertPoint:anchor toView:nil]; 214 arrowPoint = [wrenchButton convertPoint:anchor toView:nil];
215 break; 215 break;
216 } 216 }
217 default: { 217 default: {
218 NOTREACHED() << "Generic extension type not allowed in install bubble."; 218 NOTREACHED() << "Generic extension type not allowed in install bubble.";
219 } 219 }
220 } 220 }
221 return arrowPoint; 221 return arrowPoint;
222 } 222 }
223 223
224 // We want this to be a child of a browser window. addChildWindow: 224 // Override -[BaseBubbleController showWindow:] to tweak bubble location and
225 // (called from this function) will bring the window on-screen; 225 // set up UI elements.
226 // unfortunately, [NSWindowController showWindow:] will also bring it
227 // on-screen (but will cause unexpected changes to the window's
228 // position). We cannot have an addChildWindow: and a subsequent
229 // showWindow:. Thus, we have our own version.
230 - (void)showWindow:(id)sender { 226 - (void)showWindow:(id)sender {
231 // Generic extensions get an infobar rather than a bubble. 227 // Generic extensions get an infobar rather than a bubble.
232 DCHECK(type_ != extension_installed_bubble::kGeneric); 228 DCHECK(type_ != extension_installed_bubble::kGeneric);
233 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 229 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
234 230
235 // Load nib and calculate height based on messages to be shown. 231 // Load nib and calculate height based on messages to be shown.
236 NSWindow* window = [self initializeWindow]; 232 NSWindow* window = [self initializeWindow];
237 int newWindowHeight = [self calculateWindowHeight]; 233 int newWindowHeight = [self calculateWindowHeight];
238 [self.bubble setFrameSize:NSMakeSize( 234 [self.bubble setFrameSize:NSMakeSize(
239 NSWidth([[window contentView] bounds]), newWindowHeight)]; 235 NSWidth([[window contentView] bounds]), newWindowHeight)];
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
453 449
454 - (NSRect)getExtensionInstalledInfoMsgFrame { 450 - (NSRect)getExtensionInstalledInfoMsgFrame {
455 return [extensionInstalledInfoMsg_ frame]; 451 return [extensionInstalledInfoMsg_ frame];
456 } 452 }
457 453
458 - (void)extensionUnloaded:(id)sender { 454 - (void)extensionUnloaded:(id)sender {
459 extension_ = NULL; 455 extension_ = NULL;
460 } 456 }
461 457
462 @end 458 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698