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

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

Issue 17593006: mac: Update clients of scoped_nsobject.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iwyu, scoped_nsprotocol Created 7 years, 6 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
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_install_view_controller.h" 5 #import "chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 307 }
308 308
309 - (BOOL)isInlineInstall { 309 - (BOOL)isInlineInstall {
310 return prompt_->type() == ExtensionInstallPrompt::INLINE_INSTALL_PROMPT; 310 return prompt_->type() == ExtensionInstallPrompt::INLINE_INSTALL_PROMPT;
311 } 311 }
312 312
313 - (void)appendRatingStar:(const gfx::ImageSkia*)skiaImage { 313 - (void)appendRatingStar:(const gfx::ImageSkia*)skiaImage {
314 NSImage* image = gfx::NSImageFromImageSkiaWithColorSpace( 314 NSImage* image = gfx::NSImageFromImageSkiaWithColorSpace(
315 *skiaImage, base::mac::GetSystemColorSpace()); 315 *skiaImage, base::mac::GetSystemColorSpace());
316 NSRect frame = NSMakeRect(0, 0, skiaImage->width(), skiaImage->height()); 316 NSRect frame = NSMakeRect(0, 0, skiaImage->width(), skiaImage->height());
317 scoped_nsobject<NSImageView> view([[NSImageView alloc] initWithFrame:frame]); 317 base::scoped_nsobject<NSImageView> view(
318 [[NSImageView alloc] initWithFrame:frame]);
318 [view setImage:image]; 319 [view setImage:image];
319 320
320 // Add this star after all the other ones 321 // Add this star after all the other ones
321 CGFloat maxStarRight = 0; 322 CGFloat maxStarRight = 0;
322 if ([[ratingStars_ subviews] count]) { 323 if ([[ratingStars_ subviews] count]) {
323 maxStarRight = NSMaxX([[[ratingStars_ subviews] lastObject] frame]); 324 maxStarRight = NSMaxX([[[ratingStars_ subviews] lastObject] frame]);
324 } 325 }
325 NSRect starBounds = NSMakeRect(maxStarRight, 0, 326 NSRect starBounds = NSMakeRect(maxStarRight, 0,
326 skiaImage->width(), skiaImage->height()); 327 skiaImage->width(), skiaImage->height());
327 [view setFrame:starBounds]; 328 [view setFrame:starBounds];
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 return warnings; 533 return warnings;
533 } 534 }
534 535
535 - (void)updateViewFrame:(NSRect)frame { 536 - (void)updateViewFrame:(NSRect)frame {
536 NSWindow* window = [[self view] window]; 537 NSWindow* window = [[self view] window];
537 [window setFrame:[window frameRectForContentRect:frame] display:YES]; 538 [window setFrame:[window frameRectForContentRect:frame] display:YES];
538 [[self view] setFrame:frame]; 539 [[self view] setFrame:frame];
539 } 540 }
540 541
541 @end 542 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698