| OLD | NEW |
| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 isGroupItem:NO | 487 isGroupItem:NO |
| 488 children:details]; | 488 children:details]; |
| 489 } | 489 } |
| 490 | 490 |
| 491 - (NSArray*)buildWarnings:(const ExtensionInstallPrompt::Prompt&)prompt { | 491 - (NSArray*)buildWarnings:(const ExtensionInstallPrompt::Prompt&)prompt { |
| 492 NSMutableArray* warnings = [NSMutableArray array]; | 492 NSMutableArray* warnings = [NSMutableArray array]; |
| 493 NSString* heading = nil; | 493 NSString* heading = nil; |
| 494 | 494 |
| 495 if (prompt.ShouldShowPermissions()) { | 495 if (prompt.ShouldShowPermissions()) { |
| 496 NSMutableArray* children = [NSMutableArray array]; | 496 NSMutableArray* children = [NSMutableArray array]; |
| 497 if (prompt.GetPermissionCount() > 0) { | 497 if (prompt.GetPermissionCount(false) > 0) { |
| 498 for (size_t i = 0; i < prompt.GetPermissionCount(); ++i) { | 498 for (size_t i = 0; i < prompt.GetPermissionCount(false); ++i) { |
| 499 [children addObject: | 499 [children addObject: |
| 500 [self buildItemWithTitle:SysUTF16ToNSString(prompt.GetPermission(i)) | 500 [self buildItemWithTitle:SysUTF16ToNSString( |
| 501 prompt.GetPermission(i, false)) |
| 501 isGroupItem:NO | 502 isGroupItem:NO |
| 502 children:nil]]; | 503 children:nil]]; |
| 503 } | 504 } |
| 504 | 505 |
| 505 heading = SysUTF16ToNSString(prompt.GetPermissionsHeading()); | 506 heading = SysUTF16ToNSString(prompt.GetPermissionsHeading()); |
| 506 } else { | 507 } else { |
| 507 [children addObject: | 508 [children addObject: |
| 508 [self buildItemWithTitle: | 509 [self buildItemWithTitle: |
| 509 l10n_util::GetNSString(IDS_EXTENSION_NO_SPECIAL_PERMISSIONS) | 510 l10n_util::GetNSString(IDS_EXTENSION_NO_SPECIAL_PERMISSIONS) |
| 510 isGroupItem:NO | 511 isGroupItem:NO |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 return warnings; | 546 return warnings; |
| 546 } | 547 } |
| 547 | 548 |
| 548 - (void)updateViewFrame:(NSRect)frame { | 549 - (void)updateViewFrame:(NSRect)frame { |
| 549 NSWindow* window = [[self view] window]; | 550 NSWindow* window = [[self view] window]; |
| 550 [window setFrame:[window frameRectForContentRect:frame] display:YES]; | 551 [window setFrame:[window frameRectForContentRect:frame] display:YES]; |
| 551 [[self view] setFrame:frame]; | 552 [[self view] setFrame:frame]; |
| 552 } | 553 } |
| 553 | 554 |
| 554 @end | 555 @end |
| OLD | NEW |