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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc

Issue 2713803002: Views/Harmony: Use LayoutDelegate::GetMetric for views::kPanelVertMargin. (Closed)
Patch Set: Rebase. Created 3 years, 9 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 unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/extensions/extension_uninstall_dialog.h" 11 #include "chrome/browser/extensions/extension_uninstall_dialog.h"
12 #include "chrome/browser/ui/app_list/app_list_service.h" 12 #include "chrome/browser/ui/app_list/app_list_service.h"
13 #include "chrome/browser/ui/native_window_tracker.h" 13 #include "chrome/browser/ui/native_window_tracker.h"
14 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
14 #include "chrome/grit/generated_resources.h" 15 #include "chrome/grit/generated_resources.h"
15 #include "components/constrained_window/constrained_window_views.h" 16 #include "components/constrained_window/constrained_window_views.h"
16 #include "components/strings/grit/components_strings.h" 17 #include "components/strings/grit/components_strings.h"
17 #include "extensions/common/extension.h" 18 #include "extensions/common/extension.h"
18 #include "ui/base/l10n/l10n_util.h" 19 #include "ui/base/l10n/l10n_util.h"
19 #include "ui/compositor/compositor.h" 20 #include "ui/compositor/compositor.h"
20 #include "ui/compositor/layer.h" 21 #include "ui/compositor/layer.h"
21 #include "ui/views/controls/button/checkbox.h" 22 #include "ui/views/controls/button/checkbox.h"
22 #include "ui/views/controls/image_view.h" 23 #include "ui/views/controls/image_view.h"
23 #include "ui/views/controls/label.h" 24 #include "ui/views/controls/label.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 164
164 ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView( 165 ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView(
165 ExtensionUninstallDialogViews* dialog_view, 166 ExtensionUninstallDialogViews* dialog_view,
166 bool triggered_by_extension, 167 bool triggered_by_extension,
167 const gfx::ImageSkia* image) 168 const gfx::ImageSkia* image)
168 : dialog_(dialog_view), 169 : dialog_(dialog_view),
169 triggered_by_extension_(triggered_by_extension), 170 triggered_by_extension_(triggered_by_extension),
170 report_abuse_checkbox_(nullptr) { 171 report_abuse_checkbox_(nullptr) {
171 SetLayoutManager(new views::BoxLayout( 172 SetLayoutManager(new views::BoxLayout(
172 views::BoxLayout::kHorizontal, views::kButtonHEdgeMarginNew, 173 views::BoxLayout::kHorizontal, views::kButtonHEdgeMarginNew,
173 views::kPanelVertMargin, views::kRelatedControlHorizontalSpacing)); 174 LayoutDelegate::Get()->GetMetric(
175 LayoutDelegate::Metric::PANEL_CONTENT_MARGIN),
176 views::kRelatedControlHorizontalSpacing));
174 177
175 icon_ = new views::ImageView(); 178 icon_ = new views::ImageView();
176 DCHECK_GE(image->width(), kIconSize); 179 DCHECK_GE(image->width(), kIconSize);
177 DCHECK_GE(image->height(), kIconSize); 180 DCHECK_GE(image->height(), kIconSize);
178 icon_->SetImageSize(gfx::Size(kIconSize, kIconSize)); 181 icon_->SetImageSize(gfx::Size(kIconSize, kIconSize));
179 icon_->SetImage(*image); 182 icon_->SetImage(*image);
180 AddChildView(icon_); 183 AddChildView(icon_);
181 184
182 heading_ = new views::Label(base::UTF8ToUTF16(dialog_->GetHeadingText())); 185 heading_ = new views::Label(base::UTF8ToUTF16(dialog_->GetHeadingText()));
183 heading_->SetMultiLine(true); 186 heading_->SetMultiLine(true);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 242
240 } // namespace 243 } // namespace
241 244
242 // static 245 // static
243 extensions::ExtensionUninstallDialog* 246 extensions::ExtensionUninstallDialog*
244 extensions::ExtensionUninstallDialog::Create(Profile* profile, 247 extensions::ExtensionUninstallDialog::Create(Profile* profile,
245 gfx::NativeWindow parent, 248 gfx::NativeWindow parent,
246 Delegate* delegate) { 249 Delegate* delegate) {
247 return new ExtensionUninstallDialogViews(profile, parent, delegate); 250 return new ExtensionUninstallDialogViews(profile, parent, delegate);
248 } 251 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698