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

Unified Diff: chrome/browser/views/page_info_window.cc

Issue 10218: Looks like a size method got left behind in the gfx update. Also make sure th... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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/browser/views/options/options_window_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/page_info_window.cc
===================================================================
--- chrome/browser/views/page_info_window.cc (revision 4894)
+++ chrome/browser/views/page_info_window.cc (working copy)
@@ -441,11 +441,10 @@
}
// views::View overrides:
- virtual void GetPreferredSize(CSize *out) {
- DCHECK(out);
- *out = views::Window::GetLocalizedContentsSize(
+ virtual gfx::Size GetPreferredSize() {
+ return gfx::Size(views::Window::GetLocalizedContentsSize(
IDS_PAGEINFO_DIALOG_WIDTH_CHARS,
- IDS_PAGEINFO_DIALOG_HEIGHT_LINES).ToSIZE();
+ IDS_PAGEINFO_DIALOG_HEIGHT_LINES));
}
virtual void Layout() {
@@ -616,10 +615,23 @@
bool PageInfoWindow::RestoreWindowPosition(CRect* bounds,
bool* maximized,
bool* always_on_top) {
- return window()->RestoreWindowPositionFromPrefService(
+ bool restore = window()->RestoreWindowPositionFromPrefService(
g_browser_process->local_state(),
prefs::kPageInfoWindowPlacement,
bounds, maximized, always_on_top);
+
+ if (restore) {
+ // Force the correct width and height in case we've changed it
+ // or the pref got messed up (we know that some users will have
+ // the wrong preference if they ran into bug 3509). This isn't
+ // a resizable dialog, so overriding the saved width and height
+ // shouldn't be noticable.
+ gfx::Size size = contents_->GetPreferredSize();
+ bounds->right = bounds->left + size.width();
+ bounds->bottom = bounds->top + size.height();
+ }
+
+ return restore;
}
views::View* PageInfoWindow::GetContentsView() {
« no previous file with comments | « chrome/browser/views/options/options_window_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698