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

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

Issue 10896: Re-do the way browser windows are shown:... (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
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_;
}

Powered by Google App Engine
This is Rietveld 408576698