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

Unified Diff: chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc

Issue 13925019: fix GridLayout::CreatePanel for new style dialogs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: msw review Created 7 years, 8 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
Index: chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
diff --git a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
index f438100d572a514caed57c1bedbedad4f0d3e4ee..df386412d83027af9196f403135ae2e1134fa0e2 100644
--- a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
@@ -33,6 +33,12 @@ const int kIconSize = 69;
class ExtensionUninstallDialogDelegateView;
+// TODO(estade): remove this when UseNewStyle() is the default.
+int HorizontalMargin() {
+ return views::DialogDelegate::UseNewStyle() ? views::kButtonHEdgeMarginNew :
+ views::kPanelHorizMargin;
+}
+
// Returns parent window for extension uninstall dialog.
// For ash, use app list window if it is visible.
// For other platforms or when app list is not visible on ash,
@@ -202,11 +208,11 @@ string16 ExtensionUninstallDialogDelegateView::GetWindowTitle() const {
return l10n_util::GetStringUTF16(IDS_EXTENSION_UNINSTALL_PROMPT_TITLE);
}
-
gfx::Size ExtensionUninstallDialogDelegateView::GetPreferredSize() {
int width = kRightColumnWidth;
width += kIconSize;
- width += views::kPanelHorizMargin * 3;
+ width += HorizontalMargin() * 2;
+ width += views::kRelatedControlHorizontalSpacing;
int height = views::kPanelVertMargin * 2;
height += heading_->GetHeightForWidth(kRightColumnWidth);
@@ -216,7 +222,7 @@ gfx::Size ExtensionUninstallDialogDelegateView::GetPreferredSize() {
}
void ExtensionUninstallDialogDelegateView::Layout() {
- int x = views::kPanelHorizMargin;
+ int x = HorizontalMargin();
int y = views::kPanelVertMargin;
heading_->SizeToFit(kRightColumnWidth);
@@ -224,7 +230,7 @@ void ExtensionUninstallDialogDelegateView::Layout() {
if (heading_->height() <= kIconSize) {
icon_->SetBounds(x, y, kIconSize, kIconSize);
x += kIconSize;
- x += views::kPanelHorizMargin;
+ x += views::kRelatedControlHorizontalSpacing;
heading_->SetX(x);
heading_->SetY(y + (kIconSize - heading_->height()) / 2);
@@ -234,7 +240,7 @@ void ExtensionUninstallDialogDelegateView::Layout() {
kIconSize,
kIconSize);
x += kIconSize;
- x += views::kPanelHorizMargin;
+ x += views::kRelatedControlHorizontalSpacing;
heading_->SetX(x);
heading_->SetY(y);
« no previous file with comments | « chrome/browser/ui/views/confirm_bubble_views.cc ('k') | chrome/browser/ui/views/extensions/media_galleries_dialog_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698