Index: chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm |
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm |
index df708813c6d13897c38c52112c02c69dcc13e9be..819f11d5003c54c6c6677ca8731c6f9bec7c597f 100644 |
--- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm |
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm |
@@ -190,7 +190,8 @@ bool HasAttribute(id item, CellAttributesMask attributeMask) { |
} else if (prompt->has_webstore_data()) { |
nibName = @"ExtensionInstallPromptWebstoreData"; |
} else if (!prompt->ShouldShowPermissions() && |
- prompt->GetRetainedFileCount() == 0) { |
+ prompt->GetRetainedFileCount() == 0 && |
+ prompt->GetRetainedDeviceCount() == 0) { |
nibName = @"ExtensionInstallPromptNoWarnings"; |
} else { |
nibName = @"ExtensionInstallPrompt"; |
@@ -307,8 +308,8 @@ bool HasAttribute(id item, CellAttributesMask attributeMask) { |
OffsetControlVerticallyToFitContent(itemsField_, &totalOffset); |
} |
- // If there are any warnings or retained files, then we have to do |
- // some special layout. |
+ // If there are any warnings, retained devices or retained files, then we |
+ // have to do some special layout. |
if (prompt_->ShouldShowPermissions() || prompt_->GetRetainedFileCount() > 0) { |
NSSize spacing = [outlineView_ intercellSpacing]; |
spacing.width += 2; |
@@ -663,6 +664,35 @@ bool HasAttribute(id item, CellAttributesMask attributeMask) { |
[self buildDetailToggleItem:type permissionsDetailIndex:0]]; |
} |
+ if (prompt.GetRetainedDeviceCount() > 0) { |
+ type = ExtensionInstallPrompt::RETAINED_DEVICES_DETAILS; |
tapted
2014/09/19 04:09:09
What happens if an extension has both retained dev
Reilly Grant (use Gerrit)
2014/09/19 19:30:09
You get two lists and the button says "Revoke File
tapted
2014/09/22 01:04:36
Ah - cool. On the cocoa side it looked like `type`
|
+ |
+ NSMutableArray* children = [NSMutableArray array]; |
+ |
+ if (prompt.GetIsShowingDetails(type, 0)) { |
+ for (size_t i = 0; i < prompt.GetRetainedDeviceCount(); ++i) { |
+ [children |
tapted
2014/09/19 04:09:09
nit: a temporary `title` var will probably make th
Reilly Grant (use Gerrit)
2014/09/19 19:30:09
Done.
|
+ addObject:[self buildItemWithTitle: |
+ SysUTF16ToNSString( |
+ prompt.GetRetainedDeviceMessageString(i)) |
+ cellAttributes:kUseBullet |
+ children:nil]]; |
+ } |
+ } |
+ |
+ [warnings |
tapted
2014/09/19 04:09:09
same here, clang-format will probably do something
|
+ addObject:[self |
+ buildItemWithTitle:SysUTF16ToNSString( |
+ prompt.GetRetainedDevicesHeading()) |
+ cellAttributes:kBoldText | kAutoExpandCell | |
+ kNoExpandMarker |
+ children:children]]; |
+ |
+ // Add a row for the link. |
+ [warnings |
+ addObject:[self buildDetailToggleItem:type permissionsDetailIndex:0]]; |
+ } |
+ |
return warnings; |
} |