| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView( | 165 ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView( |
| 166 ExtensionUninstallDialogViews* dialog_view, | 166 ExtensionUninstallDialogViews* dialog_view, |
| 167 bool triggered_by_extension, | 167 bool triggered_by_extension, |
| 168 const gfx::ImageSkia* image) | 168 const gfx::ImageSkia* image) |
| 169 : dialog_(dialog_view), | 169 : dialog_(dialog_view), |
| 170 triggered_by_extension_(triggered_by_extension), | 170 triggered_by_extension_(triggered_by_extension), |
| 171 report_abuse_checkbox_(nullptr) { | 171 report_abuse_checkbox_(nullptr) { |
| 172 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); | 172 ChromeLayoutProvider* provider = ChromeLayoutProvider::Get(); |
| 173 SetLayoutManager(new views::BoxLayout( | 173 SetLayoutManager(new views::BoxLayout( |
| 174 views::BoxLayout::kHorizontal, | 174 views::BoxLayout::kHorizontal, |
| 175 provider->GetDistanceMetric(DISTANCE_DIALOG_BUTTON_MARGIN), | 175 provider->GetDistanceMetric( |
| 176 provider->GetDistanceMetric(DISTANCE_PANEL_CONTENT_MARGIN), | 176 views::DISTANCE_DIALOG_CONTENTS_HORIZONTAL_MARGIN), |
| 177 provider->GetDistanceMetric( |
| 178 views::DISTANCE_DIALOG_CONTENTS_VERTICAL_MARGIN), |
| 177 provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL))); | 179 provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL))); |
| 178 | 180 |
| 179 icon_ = new views::ImageView(); | 181 icon_ = new views::ImageView(); |
| 180 DCHECK_GE(image->width(), kIconSize); | 182 DCHECK_GE(image->width(), kIconSize); |
| 181 DCHECK_GE(image->height(), kIconSize); | 183 DCHECK_GE(image->height(), kIconSize); |
| 182 icon_->SetImageSize(gfx::Size(kIconSize, kIconSize)); | 184 icon_->SetImageSize(gfx::Size(kIconSize, kIconSize)); |
| 183 icon_->SetImage(*image); | 185 icon_->SetImage(*image); |
| 184 AddChildView(icon_); | 186 AddChildView(icon_); |
| 185 | 187 |
| 186 heading_ = new views::Label(base::UTF8ToUTF16(dialog_->GetHeadingText())); | 188 heading_ = new views::Label(base::UTF8ToUTF16(dialog_->GetHeadingText())); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 248 |
| 247 } // namespace | 249 } // namespace |
| 248 | 250 |
| 249 // static | 251 // static |
| 250 extensions::ExtensionUninstallDialog* | 252 extensions::ExtensionUninstallDialog* |
| 251 extensions::ExtensionUninstallDialog::Create(Profile* profile, | 253 extensions::ExtensionUninstallDialog::Create(Profile* profile, |
| 252 gfx::NativeWindow parent, | 254 gfx::NativeWindow parent, |
| 253 Delegate* delegate) { | 255 Delegate* delegate) { |
| 254 return new ExtensionUninstallDialogViews(profile, parent, delegate); | 256 return new ExtensionUninstallDialogViews(profile, parent, delegate); |
| 255 } | 257 } |
| OLD | NEW |