summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/page_info_window.cc
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 23:05:24 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-07 23:05:24 +0000
commit277c42cb1794cd6f72670617b31bb1fb8655a346 (patch)
tree9247040dede735088a67baa323bf0394f49277d6 /chrome/browser/views/page_info_window.cc
parentb5c7c2e842d66ab1ccbac33a7c8569826e4de602 (diff)
downloadchromium_src-277c42cb1794cd6f72670617b31bb1fb8655a346.zip
chromium_src-277c42cb1794cd6f72670617b31bb1fb8655a346.tar.gz
chromium_src-277c42cb1794cd6f72670617b31bb1fb8655a346.tar.bz2
Looks like a size method got left behind in the gfx update. Also make sure that we only restore the page info window position, but not the size.
Plus some dead code removal in options_window_view. BUG=3509 Review URL: http://codereview.chromium.org/10218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/page_info_window.cc')
-rw-r--r--chrome/browser/views/page_info_window.cc22
1 files changed, 17 insertions, 5 deletions
diff --git a/chrome/browser/views/page_info_window.cc b/chrome/browser/views/page_info_window.cc
index d724132..c7cbb8e 100644
--- a/chrome/browser/views/page_info_window.cc
+++ b/chrome/browser/views/page_info_window.cc
@@ -441,11 +441,10 @@ class PageInfoContentView : public views::View {
}
// 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 @@ void PageInfoWindow::SaveWindowPosition(const CRect& bounds,
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() {