| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_uninstall_dialog.h" | 9 #include "chrome/browser/extensions/extension_uninstall_dialog.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 : dialog_(dialog_view) { | 142 : dialog_(dialog_view) { |
| 143 // Scale down to icon size, but allow smaller icons (don't scale up). | 143 // Scale down to icon size, but allow smaller icons (don't scale up). |
| 144 gfx::Size size(icon->width(), icon->height()); | 144 gfx::Size size(icon->width(), icon->height()); |
| 145 if (size.width() > kIconSize || size.height() > kIconSize) | 145 if (size.width() > kIconSize || size.height() > kIconSize) |
| 146 size = gfx::Size(kIconSize, kIconSize); | 146 size = gfx::Size(kIconSize, kIconSize); |
| 147 icon_ = new views::ImageView(); | 147 icon_ = new views::ImageView(); |
| 148 icon_->SetImageSize(size); | 148 icon_->SetImageSize(size); |
| 149 icon_->SetImage(*icon); | 149 icon_->SetImage(*icon); |
| 150 AddChildView(icon_); | 150 AddChildView(icon_); |
| 151 | 151 |
| 152 heading_ = new views::Label( | 152 heading_ = new views::Label(UTF16ToWide( |
| 153 l10n_util::GetStringFUTF16(IDS_EXTENSION_UNINSTALL_PROMPT_HEADING, | 153 l10n_util::GetStringFUTF16(IDS_EXTENSION_UNINSTALL_PROMPT_HEADING, |
| 154 UTF8ToUTF16(extension->name()))); | 154 UTF8ToUTF16(extension->name())))); |
| 155 heading_->SetMultiLine(true); | 155 heading_->SetMultiLine(true); |
| 156 AddChildView(heading_); | 156 AddChildView(heading_); |
| 157 } | 157 } |
| 158 | 158 |
| 159 ExtensionUninstallDialogDelegateView::~ExtensionUninstallDialogDelegateView() { | 159 ExtensionUninstallDialogDelegateView::~ExtensionUninstallDialogDelegateView() { |
| 160 } | 160 } |
| 161 | 161 |
| 162 std::wstring ExtensionUninstallDialogDelegateView::GetDialogButtonLabel( | 162 std::wstring ExtensionUninstallDialogDelegateView::GetDialogButtonLabel( |
| 163 MessageBoxFlags::DialogButton button) const { | 163 MessageBoxFlags::DialogButton button) const { |
| 164 switch (button) { | 164 switch (button) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 } | 228 } |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace | 231 } // namespace |
| 232 | 232 |
| 233 // static | 233 // static |
| 234 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( | 234 ExtensionUninstallDialog* ExtensionUninstallDialog::Create( |
| 235 Profile* profile, Delegate* delegate) { | 235 Profile* profile, Delegate* delegate) { |
| 236 return new ExtensionUninstallDialogViews(profile, delegate); | 236 return new ExtensionUninstallDialogViews(profile, delegate); |
| 237 } | 237 } |
| OLD | NEW |