Index: chrome/browser/ui/views/extensions/extension_install_dialog_view.cc |
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc |
index 674b3ae0842679d6de9e3d726ba6d85bc8a4d5f0..fc75de0fa2176c95975941ae545fbffee14094e2 100644 |
--- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc |
+++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc |
@@ -460,7 +460,104 @@ ExtensionInstallDialogView::ExtensionInstallDialogView( |
} |
} |
} |
- } else { |
+ } |
gpdavis
2014/08/29 01:12:16
This is ugly. Since this constructor is over 300
|
+ if (prompt->GetWithheldPermissionCount() > 0) { |
+ layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
+ if (is_inline_install()) { |
+ layout->StartRow(0, column_set_id); |
+ layout->AddView(new views::Separator(views::Separator::HORIZONTAL), |
+ 3, |
+ 1, |
+ views::GridLayout::FILL, |
+ views::GridLayout::FILL); |
+ layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
+ } |
+ |
+ layout->StartRow(0, column_set_id); |
+ views::Label* permissions_header = |
+ new views::Label(prompt->GetWithheldHeading()); |
+ permissions_header->SetMultiLine(true); |
+ permissions_header->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
+ permissions_header->SizeToFit(left_column_width); |
+ layout->AddView(permissions_header); |
+ |
+ for (size_t i = 0; i < prompt->GetWithheldPermissionCount(); ++i) { |
+ layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
+ layout->StartRow(0, column_set_id); |
+ views::Label* permission_label = |
+ new views::Label(prompt->GetWithheldPermission(i)); |
+ |
+ const SkColor kTextHighlight = SK_ColorRED; |
+ const SkColor kBackgroundHighlight = SkColorSetRGB(0xFB, 0xF7, 0xA3); |
+ if (prompt->experiment()->ShouldHighlightText( |
+ prompt->GetWithheldPermission(i))) { |
+ permission_label->SetAutoColorReadabilityEnabled(false); |
+ permission_label->SetEnabledColor(kTextHighlight); |
+ } else if (prompt->experiment()->ShouldHighlightBackground( |
+ prompt->GetWithheldPermission(i))) { |
+ permission_label->SetLineHeight(18); |
+ permission_label->set_background( |
+ views::Background::CreateSolidBackground(kBackgroundHighlight)); |
+ } |
+ |
+ permission_label->SetMultiLine(true); |
+ permission_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
+ |
+ if (prompt->experiment()->show_checkboxes()) { |
+ permission_label->SizeToFit(left_column_width); |
+ layout->AddView(new CheckboxedView(permission_label, this)); |
+ ++unchecked_boxes_; |
+ } else { |
+ permission_label->SizeToFit(left_column_width - kBulletWidth); |
+ layout->AddView(new BulletedView(permission_label)); |
+ } |
+ |
+ // If we have more details to provide, show them in collapsed form. |
+ if (!prompt->GetWithheldPermissionsDetails(i).empty()) { |
+ layout->StartRow(0, column_set_id); |
+ PermissionDetails details; |
+ details.push_back(PrepareForDisplay( |
+ prompt->GetWithheldPermissionsDetails(i), false)); |
+ ExpandableContainerView* details_container = |
+ new ExpandableContainerView(this, |
+ base::string16(), |
+ details, |
+ left_column_width, |
+ true, |
+ true, |
+ false); |
+ layout->AddView(details_container); |
+ } |
+ |
+ if (prompt->experiment()->should_show_inline_explanations()) { |
+ base::string16 explanation = |
+ prompt->experiment()->GetInlineExplanation( |
+ prompt->GetWithheldPermission(i)); |
+ if (!explanation.empty()) { |
+ PermissionDetails details; |
+ details.push_back(explanation); |
+ ExpandableContainerView* container = |
+ new ExpandableContainerView(this, |
+ base::string16(), |
+ details, |
+ left_column_width, |
+ false, |
+ false, |
+ true); |
+ // Inline explanations are expanded by default if there is |
+ // no "Show details" link. |
+ if (!prompt->experiment()->show_details_link()) |
+ container->ExpandWithoutAnimation(); |
+ layout->StartRow(0, column_set_id); |
+ layout->AddView(container); |
+ inline_explanations_.push_back(container); |
+ } |
+ } |
+ } |
+ } |
+ |
+ if (prompt->GetWithheldPermissionCount() == 0 && |
+ prompt->GetPermissionCount() == 0) { |
layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
layout->StartRow(0, column_set_id); |
views::Label* permission_label = new views::Label( |