Index: chrome/browser/views/page_info_window.cc |
=================================================================== |
--- chrome/browser/views/page_info_window.cc (revision 5374) |
+++ chrome/browser/views/page_info_window.cc (working copy) |
@@ -554,11 +554,12 @@ |
// There already is a PageInfo window opened. Let's shift the location of |
// the new PageInfo window so they don't overlap entirely. |
// Window::Init will position the window from the stored location. |
- CRect bounds; |
- bool maximized, always_on_top; |
- if (RestoreWindowPosition(&bounds, &maximized, &always_on_top)) { |
- CalculateWindowBounds(&bounds); |
- SaveWindowPosition(bounds, maximized, always_on_top); |
+ gfx::Rect bounds; |
+ bool maximized = false; |
+ if (GetSavedWindowBounds(&bounds) && GetSavedMaximizedState(&maximized)) { |
+ CRect bounds_crect(bounds.ToRECT()); |
+ CalculateWindowBounds(&bounds_crect); |
+ SaveWindowPlacement(gfx::Rect(bounds_crect), maximized, false); |
} |
} |
@@ -604,36 +605,10 @@ |
return l10n_util::GetString(IDS_PAGEINFO_WINDOW_TITLE); |
} |
-void PageInfoWindow::SaveWindowPosition(const CRect& bounds, |
- bool maximized, |
- bool always_on_top) { |
- window()->SaveWindowPositionToPrefService(g_browser_process->local_state(), |
- prefs::kPageInfoWindowPlacement, |
- bounds, maximized, always_on_top); |
+std::wstring PageInfoWindow::GetWindowName() const { |
+ return prefs::kPageInfoWindowPlacement; |
} |
-bool PageInfoWindow::RestoreWindowPosition(CRect* bounds, |
- bool* maximized, |
- bool* always_on_top) { |
- 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() { |
return contents_; |
} |