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

Unified Diff: chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm

Issue 580363002: Update app info and install prompt UI to show retained devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed feedback from Avi and tapted. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
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 90cac175c2a86c88dd4df6e8d53484feeaca592a..2a42695b18f0c385c756ed3bf3cf938760b7d8eb 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_view_controller.mm
@@ -191,7 +191,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";
@@ -308,8 +309,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;
@@ -645,25 +646,50 @@ bool HasAttribute(id item, CellAttributesMask attributeMask) {
if (prompt.GetIsShowingDetails(type, 0)) {
for (size_t i = 0; i < prompt.GetRetainedFileCount(); ++i) {
- [children addObject:
- [self buildItemWithTitle:SysUTF16ToNSString(
- prompt.GetRetainedFile(i))
- cellAttributes:kUseBullet
- children:nil]];
+ NSString* title = SysUTF16ToNSString(prompt.GetRetainedFile(i));
+ [children addObject:[self buildItemWithTitle:title
+ cellAttributes:kUseBullet
+ children:nil]];
}
}
- [warnings addObject:
- [self buildItemWithTitle:SysUTF16ToNSString(
- prompt.GetRetainedFilesHeading())
- cellAttributes:kBoldText | kAutoExpandCell | kNoExpandMarker
- children:children]];
+ NSString* title = SysUTF16ToNSString(prompt.GetRetainedFilesHeading());
+ [warnings addObject:[self buildItemWithTitle:title
+ cellAttributes:kBoldText | kAutoExpandCell |
+ kNoExpandMarker
+ children:children]];
// Add a row for the link.
[warnings addObject:
[self buildDetailToggleItem:type permissionsDetailIndex:0]];
}
+ if (prompt.GetRetainedDeviceCount() > 0) {
+ type = ExtensionInstallPrompt::RETAINED_DEVICES_DETAILS;
+
+ NSMutableArray* children = [NSMutableArray array];
+
+ if (prompt.GetIsShowingDetails(type, 0)) {
+ for (size_t i = 0; i < prompt.GetRetainedDeviceCount(); ++i) {
+ NSString* title =
+ SysUTF16ToNSString(prompt.GetRetainedDeviceMessageString(i));
+ [children addObject:[self buildItemWithTitle:title
+ cellAttributes:kUseBullet
+ children:nil]];
+ }
+ }
+
+ NSString* title = SysUTF16ToNSString(prompt.GetRetainedDevicesHeading());
+ [warnings addObject:[self buildItemWithTitle:title
+ cellAttributes:kBoldText | kAutoExpandCell |
+ kNoExpandMarker
+ children:children]];
+
+ // Add a row for the link.
+ [warnings
+ addObject:[self buildDetailToggleItem:type permissionsDetailIndex:0]];
+ }
+
return warnings;
}

Powered by Google App Engine
This is Rietveld 408576698