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

Unified Diff: chrome/browser/views/extensions/extension_install_prompt.cc

Issue 173604: Adds a default icon to the install dialog if the extension (Closed)
Patch Set: Created 11 years, 4 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
« no previous file with comments | « chrome/browser/resources/default_extension_icon_128.png ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/extensions/extension_install_prompt.cc
diff --git a/chrome/browser/views/extensions/extension_install_prompt.cc b/chrome/browser/views/extensions/extension_install_prompt.cc
index cc7d41c31b97ff1cf749f7da6f30f016b5e61df9..e5c06c659d1cc20130b737bf4dbd053c9e5e9c8c 100644
--- a/chrome/browser/views/extensions/extension_install_prompt.cc
+++ b/chrome/browser/views/extensions/extension_install_prompt.cc
@@ -32,12 +32,10 @@ class InstallDialogContent : public views::View, public views::DialogDelegate {
InstallDialogContent(ExtensionInstallUI::Delegate* delegate,
Extension* extension, SkBitmap* icon, const std::wstring& warning_text)
: delegate_(delegate), icon_(NULL) {
- if (icon) {
- icon_ = new views::ImageView();
- icon_->SetImageSize(gfx::Size(kIconSize, kIconSize));
- icon_->SetImage(*icon);
- AddChildView(icon_);
- }
+ icon_ = new views::ImageView();
+ icon_->SetImageSize(gfx::Size(kIconSize, kIconSize));
+ icon_->SetImage(*icon);
+ AddChildView(icon_);
heading_ = new views::Label(
l10n_util::GetStringF(IDS_EXTENSION_PROMPT_HEADING,
@@ -93,11 +91,8 @@ class InstallDialogContent : public views::View, public views::DialogDelegate {
// View
virtual gfx::Size GetPreferredSize() {
int width = kRightColumnWidth + kPanelHorizMargin + kPanelHorizMargin;
-
- if (icon_) {
- width += kIconSize;
- width += kPanelHorizMargin;
- }
+ width += kIconSize;
+ width += kPanelHorizMargin;
int height = kPanelVertMargin * 2;
height += heading_->GetHeightForWidth(kRightColumnWidth);
@@ -105,18 +100,16 @@ class InstallDialogContent : public views::View, public views::DialogDelegate {
height += warning_->GetHeightForWidth(kRightColumnWidth);
height += kPanelVertMargin;
- return gfx::Size(width, std::max(height, kIconSize));
+ return gfx::Size(width, std::max(height, kIconSize + kPanelVertMargin * 2));
}
virtual void Layout() {
int x = kPanelHorizMargin;
int y = kPanelVertMargin;
- if (icon_) {
- icon_->SetBounds(x, y, kIconSize, kIconSize);
- x += kIconSize;
- x += kPanelHorizMargin;
- }
+ icon_->SetBounds(x, y, kIconSize, kIconSize);
+ x += kIconSize;
+ x += kPanelHorizMargin;
heading_->SizeToFit(kRightColumnWidth);
heading_->SetX(x);
« no previous file with comments | « chrome/browser/resources/default_extension_icon_128.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698