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

Unified Diff: chrome/browser/views/frame/browser_view.cc

Issue 460066: Merge 33798 - Fix download dialog truncation in German locale.... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 years 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/app/resources/locale_settings_zh-TW.xtb ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/frame/browser_view.cc
===================================================================
--- chrome/browser/views/frame/browser_view.cc (revision 33801)
+++ chrome/browser/views/frame/browser_view.cc (working copy)
@@ -62,6 +62,7 @@
#include "grit/app_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#include "grit/locale_settings.h"
#include "grit/theme_resources.h"
#include "grit/webkit_resources.h"
#include "views/controls/single_split_view.h"
@@ -326,6 +327,15 @@
explanation_->set_border(views::Border::CreateEmptyBorder(10, 10, 10, 10));
layout->StartRow(0, columnset_id);
layout->AddView(explanation_);
+
+ dialog_dimensions_ = views::Window::GetLocalizedContentsSize(
+ IDS_DOWNLOAD_IN_PROGRESS_WIDTH_CHARS,
+ IDS_DOWNLOAD_IN_PROGRESS_MINIMUM_HEIGHT_LINES);
+ const int height =
+ warning_->GetHeightForWidth(dialog_dimensions_.width()) +
+ explanation_->GetHeightForWidth(dialog_dimensions_.width());
+ dialog_dimensions_.set_height(std::max(height,
+ dialog_dimensions_.height()));
}
~DownloadInProgressConfirmDialogDelegate() {
@@ -333,10 +343,7 @@
// View implementation:
virtual gfx::Size GetPreferredSize() {
- const int kContentWidth = 400;
- const int height = warning_->GetHeightForWidth(kContentWidth) +
- explanation_->GetHeightForWidth(kContentWidth);
- return gfx::Size(kContentWidth, height);
+ return dialog_dimensions_;
}
// DialogDelegate implementation:
@@ -384,6 +391,8 @@
std::wstring product_name_;
+ gfx::Size dialog_dimensions_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadInProgressConfirmDialogDelegate);
};
« no previous file with comments | « chrome/app/resources/locale_settings_zh-TW.xtb ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698